HTTPWebRequest and Redirect

  • Thread starter Thread starter Hawksey
  • Start date Start date
H

Hawksey

I would like to be able to programatically(Using HTTPWebRequest and
HTTPWebResponse) FORM post a user's credentials to a HTTPS login page
(.ascx)control. The problem I think I have after attempting this and
after reading other posts is; that if the login is successful data is
retrieved from DB telling the login process where(which page) this user
will be redirected to(different company users will go to different
pages). Is it possible to get this redirect string into a variable and
get it out of the request.GetResponse, with the cookie which would also
have been created with successful login and do a redirect to the page
from the posting client.

Hope this makes sense.
 
So is this a page or a control? If it's a .ascx, it is not a page.

In any case, you should write a web service that is capable of
authenticating your user. It will be much easier to call, process the
response from, etc.

Both your .ascx and your web service can call some method to do the
authentication, so that you only need to write that code once.
 
Thanks for your quick responses....
It is a user control.... page was just being used as a general
explanation..

Brock...Thanks for your help...I think have to look at the available
methods to HTTPWebrequest a little closer...I was using the example in
this URL http://odetocode.com/Articles/162.aspx, but could not quite
get it to work I guess I'll investigate a bit further....

Thanks again!
 
Back
Top