<asp:TextBox ID="TextBox1" runat="server" ValidationGroup="Regex"></asp:TextBox> <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox1" ErrorMessage="Invalid" ValidationExpression="[0-9]{0,5}" ValidationGroup="Regex"></asp:RegularExpressionValidator> <asp:Button ID="btnTestRegex" runat="server" Text="Valid Or Not?" ValidationGroup="Regex" />
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> <asp:Label ID="lblValid" runat="server" Text="Valid" Visible="false"></asp:Label> <asp:Label ID="lblInvalid" runat="server" Text="Invalid" Visible="false"></asp:Label> <asp:Button ID="Button3" runat="server" onclick="Button2_Click" Text="Button" />
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)