I have a TextBox in a Windows application in C#.
I want to validate it so that the user can input only the website address in the proper format.
How can I do this?
I have a TextBox in a Windows application in C#.
I want to validate it so that the user can input only the website address in the proper format.
How can I do this?
System.Uri.IsWellFormedUriString(userInput, System.UriKind.Absolute)
or use a regular expression:
What is the best regular expression to check if a string is a valid url
In web application, go to toolbox, then select validation tools. In validation, choose Regular Expression Validator-is a error messager. In the property of regular expression validator, choose ValidationExpression-then select Internet Url