What is the use of CausesValidation property in Asp.Net?

 Posted by vishalneeraj-24503 on 1/24/2014 | Category: ASP.NET Interview questions | Views: 942 | Points: 40
Answer:

CausesValidation is a property used in Buttons i.e. Command button,Link button,Imagebutton which is used to prevent validation.
It ensures that whether validation should be performed or not.it has True/False value.When we have to perform any validation on button like Save button then we have to set it to true.
And when we do not have to perform validation in button like Delete,Reset,New then set this property to False.

For Example:
<asp:Button id="btn_delete" CausesValidation="False" runat="server" Text = "Delete" />

<asp:Button id="btn_save" CausesValidation="True" runat="server" Text = "Save"/>


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response