How to validate a URL

  • Thread starter Thread starter ALI-R
  • Start date Start date
A

ALI-R

How can I programmatically figure out the a URL that user has been entered
is valid or not ,I mean wethere it exist or not????

thanks
 
What you mean a URL exists or not?
Do you want to check for certain parameters passed in the query string. For
the you need to use Request.QueryString["parameterName"]
 
I want to check that URL exist in internet or internaet ??

Thanks for your help
Kumar Reddi said:
What you mean a URL exists or not?
Do you want to check for certain parameters passed in the query string. For
the you need to use Request.QueryString["parameterName"]

ALI-R said:
How can I programmatically figure out the a URL that user has been entered
is valid or not ,I mean wethere it exist or not????

thanks
 
Well .NET uses the HttpWequest and HttpWebResponse objects. You can do a
search on those. The theory is that you make a request passing the url. Then
you will get a response back. If the response code you got back is a 404
Error (Page not found), then the URL does not exist.
Easier said that done I guess.
 
Well .NET uses the HttpWequest and HttpWebResponse objects. You can do a
search on those. The theory is that you make a request passing the url.
Then
you will get a response back. If the response code you got back is a 404
Error (Page not found), then the URL does not exist.
Easier said that done I guess.

Yes indeed though, of course, the site could be down for maintenance or
whatever while you're running the check...
 
Back
Top