Forum Moderators: open

Message Too Old, No Replies

Testing a URL in ASP

For use in an IFrame

         

Mr_Brutal

10:46 am on Nov 25, 2004 (gmt 0)

10+ Year Member



Hi all,

I've searched around a bit but not having much luck.

Can anyone suggest a technique to test that a url passed in a querystring is an existing URL? This gives me a chance to test it before I display it in an IFrame. The passed URL is always from trusted sources but I just wanted to avoid having possible 404s if i can.

Cheers

txbakers

3:14 pm on Nov 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use: Response.Write(URL)

to see if it is in the format you are expecting

Mr_Brutal

4:48 pm on Nov 25, 2004 (gmt 0)

10+ Year Member



Cheers txBakers but what i had in mind was to test whether the URL existed, not just the strings format. I actually found some asp code to check the HTTP Status for a 200 which is exactly what I wanted.

Then I realised that you get 200's on custom 404 pages. So it turns out I can't do it anyway, as I can't be sure im not getting redirected to a custom page.

Thanks anyway