How to bypass Required FieldValidators using VS2003?
-
Hi all! :laugh: I am facing problems while writting an Asp.net application in VS2003. Actually I have four text boxes on a web page everyone has its own requiredfiled validator and having two buttons on the same web form. Now, Whenever, I will hit either button the both validators will validate and the IsValid returns false. I want to validate only two validators by pressing buttons. Example: It will work like this, when I will press Button1 then only first two text boxes validate and other remains not validate and vis-a-versa. The following is snippet of my web page: <asp:TextBox ID="text1" runat="server" /> <asp:RequiredFieldValidator ID="rfv1" runat="server" ControlToValidate="text1" ErrorMessage="validate" /> <asp:TextBox ID="text2" runat="server" /> <asp:RequiredFieldValidator ID="rfv2" runat="server" ControlToValidate="text2" ErrorMessage="validate" /> <asp:TextBox ID="text3" runat="server" /> <asp:RequiredFieldValidator ID="rfv3" runat="server" ControlToValidate="text3" ErrorMessage="validate" /> <asp:Button id="button1" runat="server" OnClick="button1_Click" /> <asp:Button id="button2" runat="server" OnClick="button2_Click" /> Gaurav Arora
-
Hi all! :laugh: I am facing problems while writting an Asp.net application in VS2003. Actually I have four text boxes on a web page everyone has its own requiredfiled validator and having two buttons on the same web form. Now, Whenever, I will hit either button the both validators will validate and the IsValid returns false. I want to validate only two validators by pressing buttons. Example: It will work like this, when I will press Button1 then only first two text boxes validate and other remains not validate and vis-a-versa. The following is snippet of my web page: <asp:TextBox ID="text1" runat="server" /> <asp:RequiredFieldValidator ID="rfv1" runat="server" ControlToValidate="text1" ErrorMessage="validate" /> <asp:TextBox ID="text2" runat="server" /> <asp:RequiredFieldValidator ID="rfv2" runat="server" ControlToValidate="text2" ErrorMessage="validate" /> <asp:TextBox ID="text3" runat="server" /> <asp:RequiredFieldValidator ID="rfv3" runat="server" ControlToValidate="text3" ErrorMessage="validate" /> <asp:Button id="button1" runat="server" OnClick="button1_Click" /> <asp:Button id="button2" runat="server" OnClick="button2_Click" /> Gaurav Arora
Probably not much help but .NET 2.0 has the ValidationGroup property which allows you to do what you want. I think you have to resort to CustomValidators to get what you want but it's been a long time since I did anything .NET 1.1.
-
Probably not much help but .NET 2.0 has the ValidationGroup property which allows you to do what you want. I think you have to resort to CustomValidators to get what you want but it's been a long time since I did anything .NET 1.1.
Thanks for your attempt, I knew how to handle it in .NET2.0 but I want to do the same in .NET1.1, the requirement demanded so. I have to use Requirefieldvalidator not Custo,Validator. Thanks :laugh: