Click here to Skip to main content
15,908,675 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have two link button:
ASP.NET
<asp:LinkButton Id="linkButton" Runat="server" CommandName="Report" ValidationGroup="group1">

ASP.NET
<asp:LinkButton Id="linkButton2" Runat="server" CommandName="Report" ValidationGroup="group2">


with Two textboxes each:
ASP.NET
<asp:TextBox Id="txtStart" Runat="server" MaxLength="11" Width="100"></asp:TextBox>

ASP.NET
<asp:TextBox Id="txtEnd" Runat="server" MaxLength="11" Width="100"></asp:TextBox>


then each textbox has a 1 RequiredValidator and 2 CustomValidator:
ASP.NET
<asp:RequiredFieldValidator Id="reqB" Runat="server" ValidationGroup="group1" ControlToValidate="txtEnd" ErrorMessage="Please enter an End Date">*</asp:RequiredFieldValidator>

ASP.NET
<asp:CustomValidator Id="startValB" Runat="server"  ErrorMessage="Please enter a valid End Date (mm/dd/yy)">*</asp:CustomValidator>

ASP.NET
<asp:CustomValidator Id="endValB" Runat="server" ErrorMessage="End Date must be greater than or equal to the Start Date">*</asp:CustomValidator><br>


My question is, on how to create a correct ValidationGroup on these items? Any help would be highly appreciated. Thank you.
Posted
Comments
VishwaKL 5-Jun-13 2:24am    
Every validation control has validation group property you can use that to validate
Ahmed Bensaid 5-Jun-13 4:40am    
Hello,
Use the ValidationGroup property of the CustomValidator tag ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900