Validation for an IP address?

Kmandapalli
Posted by Kmandapalli under ASP.NET category on | Points: 40 | Views : 1685
public class IPAddressTextBox: RegExTextBox
{
public IPAddressTextBox()
{
InitializeComponent();
this.ValidationExpression = @"^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$";
this.ErrorMessage = "The IP address must be in the form of 111.111.111.111";
}

Comments or Responses

Login to post response