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

Tripati_tutu
Posted by Tripati_tutu under HTML 5 category on | Points: 40 | Views : 2946
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:
<html>
<body>
<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" />
</form>
</body>
</html>

Comments or Responses

Login to post response