Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
http://70.110.9.303/message/External/Courses/CD001_1/v09/CD001_1/Consent%20(SCORM%201.2).htm

What I have tried:

ValidationExpression="^([a-zA-Z0-9]+(\.[a-zA-Z0-9]+)+.*)$"

Thanks
Posted
Updated 10-Oct-17 3:17am
v2
Comments
Thanks7872 10-Oct-17 8:14am    
What do you mean by validate?
Member 10506503 10-Oct-17 8:23am    
Sir ,i want to check this url is valid or not

Url Validation

1 solution

Try this code..

private bool ValidateUrl(string url)
{
    Uri validatedUri;

    if (Uri.TryCreate(url, UriKind.Absolute, out validatedUri)) //.NET URI validation.
    {
        //If true: validatedUri contains a valid Uri. Check for the scheme in addition.
        return (validatedUri.Scheme == Uri.UriSchemeHttp || validatedUri.Scheme == Uri.UriSchemeHttps);
    }
    return false;
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900