Sub Button_Click( s As Object, e As EventArgs )
If IsValid Then
Response.Redirect( "ThankYou.aspx" )
End If
End Sub
RegularExpressionValidatorLength.aspx
Enter your last name:
(no more than 10 characters)
id="txtLastname"
Columns="50"
Runat="Server"/>
ControlToValidate="txtLastname"
Display="Dynamic"
Text="Your last name can contain
a maximum of 10 characters and no spaces!"
ValidationExpression="\S{0,10}"
Runat="Server" />
Text="Submit"
OnClick="Button_Click"
Runat="Server"/>