User Nawal Omar has sent us the following question:
…is there is a similar function in survey solution for URL validation I found out recently they introduced this : self.IsValidEmail() but it only works for email validation
One can start with the standard C# method
Uri.IsWellFormedUriString() as documented here:
But this may be too generic for most common uses and may require subsequent restriction to a particular scheme, such as illustrated in the “PUBLIC EXAMPLE Unicode Text and Formatting”
(even though the browser accepts the specified string).
It may take quite a bit of fine-tuning to narrow down to a particular range of addresses that you wish to treat as “valid” while treating the rest as invalid. If the C# standard function is not giving sufficient flexibility, consider using regular expressions, which should give you full flexibility on formulating what to consider desirable. There are plenty of examples in the internet, such as, for example, this 3rd party website:
Hope this helps, Sergiy