a) For ASP.NET web forms applications, use validation controls as suggested in the Application Development Standards for Microsoft .NET Section 4.2. Microsoft ASP.NET site has the following link to show how to validate user input with validation helper. For ASP.NET MVC applications, use System.ComponentModel.DataAnnotations name space to add validation of data type, range with regular expression checks etc. An example using DataAnnotations can be found here