Related Posts Plugin for WordPress, Blogger...

About

Follow Us

Showing posts with label Server Side Validations. Show all posts
Showing posts with label Server Side Validations. Show all posts

Sunday, 1 March 2015

Client side validation is best option for input validation, but if Javascript of browser is disable then client side validation will not work. In that case server side validation is needed. We must use both type of validations.

In this article I will explain how to validate asp.net controls e.g. TextBox, CheckBox, RadioButton, DropDownList, CheckBoxList, RadioButtonList and ListBox through code i.e. server sidevalidation  in Asp.net using both C# and VB language code.

Monday, 9 February 2015

Introduction:
Difference between Page.Isvalid and Page.Validate is also important interview question. When we create a web form for taking user input e.g. login form or contact us form in asp.net we have to validate the user input before submitting to server so that only validated data could be submitted to server.
Javascript validations are not secure. We should use Page.Validate() method and  Page.IsValid property  to validate data.
 Page.IsValid is a property to check whether page validation succeeded or not.
The Page.Validate() method is fired automatically by controls that have the CausesValidation property set to true. Note that the Button control’s CausesValidation property is true by default.
We should check this property only after calling the Page. Validate () method, or set the CausesValidation property to true which is by default true for button control.