S511 Tech Foundations of Net-enabled Organizations

Assignment 3 - Working with ASP .NET Web forms

Due: Sunday Nov 14 2004 by 11:59PM

Objectives of this assignment

The primary objective of this assignment is to create ASP.NET Web forms. There are two parts to this assignment: (1) A user profile web form, and (2) A simple stock calculator

Part 1. User profile Web form

You are creating a web form to handle a user account information screen. Name this web form userprofile.aspx. Almost all e-business applications have the ability to let the users create an account so that they can receive personalized services. In this assignment, you will create a web form which allows a user to create and edit their personal information. Since we have not studied databases yet, you will not actually store the user information in a database, but instead you will simply keep the information in memory while the application is running, and allow users to change them.

Since our web form will be an application by itself, it will actually have two components. At the top of the form, you will display a regular form that allows the user to enter information into the form, such as their name, username, password, address, phone numbers, credit card numbers, and so forth. As in assignment 1, you can pick any e-business to mimic, you should probably mimic the same business that you used for Assignment 1. However, it should have the following criteria:

  1. There should be at least 10 fields (lastname, firstname, address, etc.)
  2. At least 1 should be a password field which needs to be verified
  3. At least 1 should be a numeric field within a certain range (e.g., GPA)
  4. At least 1 should be a field with a certain number of digits (e.g., phone number, SSN, etc.)
  5. At least 1 should be an email address field.
  6. At least 1 should be required (note that you can combine multiple items here. The required field could be email address, which allows you to fulfill both requirements)
  7. At least one should be a username field.
  8. At least one should be a URL field

If the business you chose does not have a customer form containing fields with all the above criteria, you can just add some more fields.

Create a web form which looks similar to the web form in the business you chose. Your web form should have dynamic validation, and it should have the following properties:

  1. The password field should have a verification field. The passwords must not show on the screen, and your form should indicate whether or not the passwords matched.
  2. The numeric field must be checked for the appropriate range. Your form should indicate what the valid range should be. (e.g.: Enter your GPA (between 0 and 4): ___________)
  3. The fixed digit field must be verified to have the right number of digits.
  4. The email address should be checked for the standard username@domain format.
  5. The required field(s) cannot be left empty.
  6. The URL field should point to an image. So it should start with http://, and end with a .gif or .jpg extension.
  7. The username field is usually checked for uniqueness - however, since we are not storing the usernames, we are going to play a little game instead of checking for uniqueness. We are going to assume that a username is unique if it satisfies the following:
    1. The username should be between 5 and 10 characters long
    2. The username must not start with a numeric digit.
    3. The username must end with a numeric digit.

    If the username indicated satisfies the above, only then allow it, otherwise generate an error message.

When the submit button is clicked, if all fields pass validation, you should display a rendered version of the data. If your site has a page with the rendered version of the user information, try to mimic that page. Otherwise create your own rendered version. An example of such web forms is MSN Messenger profile. You can right click on any contact in messenger, and click "View Profile" - you get the rendered version of the form. To get the form itself, go to Tools > Options, and in the middle of the screen for the "General" tab you will find an "Edit Profile" button which will take you to your form. You can use this as your model.


Part 2 - Stock Calculator

In this part of the assignment, you will be creating a simple stock calculator, which allows the user to enter up to 3 stock symbols, names, current price of each share, price at which the user bought the shares, and the number of shares bought. The webform would allow the user to enter all the information, and indicate whether the user has a gain or a loss. The gain/loss should be indicated in dollars, as well as in percent. You should show the gain/loss for each of the stocks, as well as the cumulative gain/loss. If the result is a gain, you should show it in green, and if the result is a loss, you should show it in red.

Name this form stocks.aspx.


What to Submit

You will need to submit the following (follow the naming conventions exactly, otherwise you will not get the credit). Both the forms must show your name and username, as well as in the footer it should indicate the declaration stating "I have neither given nor received unauthorized aid on this deliverable." Make sure the files are submitted in proper case (in this case, everything is in lowercase):

Make sure that both your Web forms have a link to the URL where a working version of your webform can be found, just in the case I am not able to run your webform on my server for any reason. For most of you, this will be a link to your web server on bl-uits-clark.

How to Submit

To submit your assignment, follow the steps below:


Individual assignment policy

This assignment is an individual assignment. You are to work on this assignment solely by yourself with no direct help from any other student in the class or outside. You are welcome to post your questions or doubts on the course discussion forums as long as that does not involve posting part or whole of your solution. You can email me your questions if you need someone to look at your code. You can ask a fellow student for small help such as help with fixing a parse error, or a doubt about a statement in the assignment. However, the following will be considered violation of the individual policy and you will be penalized if you violate this policy: