user name password length
I have a text box for users to add their password and I want to preve开发者_Go百科nt the user from adding one character in the text box ,How Can I do this?
use a validater something like:
<asp:RangeValidator
ControlToValidate="tbox1"
MinimumValue="1"
MaximumValue="100"
Type="Integer"
EnableClientScript="false"
Text="The value must be from 1 to 100!"
runat="server" />
or
<asp:RegularExpressionValidator
ID="regexTextBox1"
ControlToValidate="YourTextBoxID"
runat="server"
ValidationExpression="^[\s\S]{1,200}$"
Text="200 characters max" />
精彩评论