Description: InThere is no better way to do this than hack code in ASP. NET 1.1.This problem can be easily resolved by adding the Validatorgroup property to all validator controls and buttons (button, LinkButton, and so on) in ASP. NET 2.0. If there is a textbox in the page and next to him there is a RequiredFieldValidator and button control, The ValidationGroup property of the RequiredFieldValidator and button can be set to the same value so that only the validor of the RequiredFieldValidator is triggered when the button is clicked, Any other validator that are not defined within the ValidationGroup will be ignored.
Example:
text boxes and data validation controls:
<asp:textbox id= "Txtoldps" runat= "Server" width= "150px" ></asp:TextBox>
<asp:requiredfieldvalidator id= "RequiredFieldValidator1" runat= "Server" controltovalidate= "Txtoldps"
Display= "None" errormessage= "<b> friendly reminder </b><br/> Please enter the original password!! "Validationgroup=" ></asp:RequiredFieldValidator> "ValidataGroup1"
Button event:
<asp:button id= "Buttonok" runat= "Server" text= "Modify" onclick= "Edit_click" validationgroup= "ValidataGroup1"/>
The other button does not need to be set ValidationGroup
<asp:button id= "Buttonok" runat= "Server" text= "Exit" onclick= "Exit_click"/>
Focus: Verify that the control and button settings are the same as the validationgroup= "ValidataGroup1" property value.
Asp. NET one page multiple button buttons events avoid data validation controls RequiredFieldValidator conflict methods