Print

Project: Input Validation

Requirements

  1. Develop an ASP.NET website (not project) with a login page containing the following form fields:
    • Username: required; max. 5 characters (using JavaScript)
    • Password: required; max. 10 characters (using JavaScript)
  2. Use ASP.net requiredfieldvalidator to validate the required form fields and 
  3. Create three submit bottons and use the regex class to validate the following requirements.:
    1. Button #1 (captioned: "Blacklist"): using a blacklist to reject the following metachacaters: "^ $ \ / ( ) | ? + * [ ] { } ><" and return a message for either the input is valid or not in a Lable control.
    2. Button #2 (captioned: "Whitelist"): using a whitelist to take only 0-9 and A-Z and return a message for either the input is valid or not in a Lable control.
    3. Button #3 (captioned: "Sanitization"): sanitize input to remove following metachacaters: "^ $ \ / ( ) | ? + * [ ] { } ><" and display the result in a Lable control
    4. Button #4 (captioned: "HTML Encode"): HTML encode input and display the result in a Message Box.