473,406 Members | 2,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

URL validation in a textbox

I have a text box where user is supposed to enter a URL , 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
Nov 16 '05 #1
2 3272
Use the HttpWebResponse class to try to connect to the resource. If you get
back a 404, then it does not exist.

On a side note, it might not be worth the effort to validate that the
resource actually exists. There is a lot of overhead with web connections.
This is my opinion and obviously depends on your application's needs.
"ALI-R" <ne****@microsoft.com> wrote in message
news:OK**************@TK2MSFTNGP09.phx.gbl...
I have a text box where user is supposed to enter a URL , 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

Nov 16 '05 #2
It is acutally in our interanet not Internet and I have to do that .the
reasion is below:

I have several Sql servers on the network ,some of them has reporting
services installed on it and some dosn't have.Unfortunately there is no way
of lisitng existing Reporting servers,so what I have to do is to list sql
seevrs and when user clicks on it ,kind of message that say,"there is no
reporting service insatlled on this server choose another one"

Thanks for your help,anyways
ALI
"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Use the HttpWebResponse class to try to connect to the resource. If you get back a 404, then it does not exist.

On a side note, it might not be worth the effort to validate that the
resource actually exists. There is a lot of overhead with web connections. This is my opinion and obviously depends on your application's needs.
"ALI-R" <ne****@microsoft.com> wrote in message
news:OK**************@TK2MSFTNGP09.phx.gbl...
I have a text box where user is supposed to enter a URL , 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


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Rick | last post by:
I have an interesting problem when I run the following code in Netscape (7.02) vs. IE. This page works great in IE and all my controls bring up the validation summary dialog box if the required...
7
by: A.M | last post by:
Hi, I have a validation control in my page that upon any invalid data, it disables all buttons in the page. basicly i don't have any postback in the page if the validator finds any error. How...
0
by: Boltar | last post by:
Hello, I am trying to use a CustomValidator control to perform client-side validation via a server callback. I have an example below that validates if a textbox contains an odd number. I...
1
by: Arpan | last post by:
I have a Web Form in my ASPX page which makes use of Web controls & incorporates validation controls. This is the code snippet that does the needful: <form runat=server> NAME:<asp:TextBox...
2
by: Tim Frawley | last post by:
Source code attached indicates my problem with validation and a button bar save button. Fill the Textbox with some text then tab off the control. The message box will display the text in the...
1
by: Buddy Ackerman | last post by:
I don't know what the problem is. I have a form with several controls that need to be validated, I put a validation group in every form control, every validatoino control, the submit button and...
2
by: winnie_us99 | last post by:
Hi All, I am trying to do validation on my text field before going to the next page to create a user. It doesn't look like the next button will fire any validation. Am I missing something? Can...
12
by: Dabbler | last post by:
I need to insure that at least one of three phone number fields has a value (requiredfield) but I'm not sure of a way to implement this without server side logic. Is there a way to use the...
6
by: Jon Paal | last post by:
validation doesn't fire what's missing ????? /////// ---- code -----/////////////////////////// Sub btnSubmit_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) 'Handles...
4
by: HenrikL | last post by:
Hi. I have a textbox that have a binding on it with converter and validationrules. When a validation error ouccur the foreground of the textbox will change to red cause it has a style.triggers...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.