Give a sample code snippet for ASP.NET RangeValidator server control?

Posted by Tripati_tutu under HTML 5 category on | Points: 40 | Views : 2939
The work of RangeValidator is to validate a specific range defined by the user.
The syntax to create a validation server control is:
<asp:control_name id = "some_id" runat = "server" />

Sample Code:
<form runat ="server" action ="" >
Enter a number from 1 to 100:
<asp:TextBox ID ="txt1" runat ="server" />
<br /><br />
<asp:Button Text ="submit" runat ="server" />
<br />
<asp:RangeValidator ControlToValidate ="txt1" MinimumValue ="1" MaximumValue ="100" Type ="Integer"
EnableClientScript ="false" Text ="The value must be from 1 to 100" runat ="server" />

Comments or Responses

Login to post response