Web Developer
Thursday, September 27, 2012
Disallow space using regular expression validator in asp.net
Here is the full HTML code:
<html xmlns="http://www.w3.org/1999/xhtml"><br /> <head runat="server"><br /> <title>Disallow space using regular expression validator in asp.net</title><br /> </head><br /> <body><br /> <form id="form1" runat="server"><div><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br /> <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="TextBox1" ValidationExpression="^\S*$" ForeColor="Red" ErrorMessage="Do not enter space!"></asp:RegularExpressionValidator><br /> <br /> <asp:Button ID="btnTest" runat="server" Text="Click to Test" onclick="btnTest_Click" /><br /> </div></form></body><br /> </html><br />
Older Posts
Home
Subscribe to:
Posts (Atom)