ASP.NET includes a number of useful server controls which can be used by developers to quickly add sophisticated functionality to a web form. The server validation controls provided by ASP.NET are used to check the information entered by visitors to your site into form fields and display error messages if there are problems with the entries. This process is referred to as validation and is an essential part of the information gathering process. Validation requires that you lay down some ground rules for each of the key fields in your form. How strict these rules are how strictly you enforce them is up to you. You will probably want to strike a balance between rules which are not so lax that they allow users to submit rubbish via your form and not so strict that they put users off.

Some types of control are more likely to require validation than others. For example, text boxes in which the user can choose to enter any information they like is likely to require more checking than a check box which can be checked or unchecked and nothing else. In addition, some fields will require multiple validation checks while others will require only one or perhaps none at all.

The Microsoft ASP.NET validation server controls provide web developers with both server-side and client-side validation. Server-side validation takes place on the server and is usually implemented using one of the two main languages used in ASP.NET web development: VB.Net or C#. Client-side validation takes place in the user’s browser and is usually done using JavaScript, before the form is sent to the server.

There are benefits and drawbacks to both client-side and server-side validation. From the user’s point of view, client-side validation is quicker and also frees up the server to perform other tasks. However, it is in no way secure. It is easy for the user to look at the source code of the page and see what type of validation is being performed. It is also possible for the user to disable the execution of JavaScript within their browser’s preferences.

The drawbacks found with server-side validation are that it is slightly slower and uses more of the server’s precious processing power. However, it is secure and allows developers to set up validation procedures which users cannot side-step.

Since both client-side and server-side have definite benefits, it is usually best to implement both of them when creating forms. The validation server controls found in ASP.NET make this very doable and very easy.

Does your team need to start ASP.NET website development? Macresource Computer Training offer Microsoft ASP.NET on-site courses in London and all over the UK.

Tags: , , , ,