C# detect page redirect

Posted by petebob796 on Stack Overflow See other posts from Stack Overflow or by petebob796
Published on 2010-03-29T14:58:58Z Indexed on 2010/03/29 15:03 UTC
Read the original article Hit count: 341

Filed under:
|

I am trying to determine if a qualification exists on http://www.accreditedqualifications.org.uk in the form:

http://www.accreditedqualifications.org.uk/qualification/50084811.seo.aspx

50084811 being a qualification aim entered by the end user.

If they enter an invalid one e.g.

http://www.accreditedqualifications.org.uk/qualification/50084911.seo.aspx

They are redirected to an error page (with incorrect http headers as far as I can see). Is there a way to detect the redirect in C#. I would hope to be able to detect the redirect in http headers (thinking it will issue 2) or similar as oppose to having to download the whole page. This could be happening a lot so I would like to minimize traffic.

© Stack Overflow or respective owner

Related posts about c#

Related posts about webclient