How to validate a URL

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
 
K

Kumar Reddi

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"]
 
A

ALI-R

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
 
G

Guest

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.
 
M

Mark Rae

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top