Hi I need to validate that a textbox should accept only url names. Can anybody tell me please. I would be really thankful.
I don´t think there is a built in method or class that you can use to validate a string as a legal url. But you can use regex, something like ["^a-zA-Z0-9-._"]+.([a-zA-Z][a-zA-Z]) If you use the code from Ranhiru you will not get it right with for instance bild.de and s.int which are both valid urls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With