Validate and Process a Web Form:Collect the users name, complete address, date of birth, phone number, email address, username and password using textboxes.

You will be graded on the form appearance as well as the use of ASP web forms, using C# to process the form, using validation controls to validate the form, as well as the level of configuration, difficulty and integration with content on the page. 

  1. In the pages folder, add a web form using your master page, and name the page Week2.aspx.
  2. This week you are to create a web form. Use only Web Server controls for the form fields (Not HTML Controls!). You may use HTML controls for the layout of the form.
  3. The form should have the labels lined up and easy to enter the data.
  4. The form fields and all web controls with ids, should have descriptive names.
  5. Use proper indentation and comments for the major sections of your code.
  6. The heading on the page should be “Membership Signup Page”
  7. Include directions for the user indicating the form input requirements.

Form Contents:

  1. Collect the users name, complete address, date of birth, phone number, email address, username and password using textboxes. The state can be a dropdown list.
  2. Dropdown lists should identify what age group the user belongs to: child, teenager, adult.
  3. Radiobuttons should be used to identify gender: male, female, no response
  4. Radiobuttons should be used to identify user preference: audio, hardcover, paperback
  5. Checkboxes should provide a list the titles of the five The New York Times Best Sellers from http://www.nytimes.com/books/best-sellers/. 
  6. Dropdown lists should provide a list of at least 6 genres: mystery, fiction, science fiction, non-fiction, biography, historical, children’s, poetry, adventure, fantasy, contemporary, romance, novel, gothic. science, informational, traditional literature, classics. The user should be able to pick multiple genres.
  7. Include a button to submit the form.
  8. One textbox should allow the user to enter comments across multiple lines of text.
  9. Valid credit card number and type, expiration date and CV code.
  10. User ID should be assigned to the new member and displayed to the user. They should not be able to change the iD.

You may want to visit http://www.regular-expressions.info/creditcard.html (Links to an external site.)Links to an external site. or other web site to locate sample code numbers for credit cards and the regular expressions used.

Validate the form data using validation controls.

  1. All fields are required.
  2. the password is shown as a password with asterisks.
  3. The email is a valid format.
  4. The user name is strong and at least 10 characters and a mix of upper, lower and special characters and numbers.
  5. The zip code cannot be alpha characters.
  6. The birthdate myst be a valid date and after 1900.
  7. Use a validation summary control to show all the errors in one location on the page.

Send the output to the client.

  1. Use Page.IsPostback to determine if the user has completed the form. If they have not been there before, display the form. If the form is completed and valid, hide the form and show the results nicely formatted to the user.
  2. If the form is valid, then show the user what the values were and indicate that the form was successfully submitted. If the form was not valid, display appropriate error messages.
find the cost of your paper