HTTPWebRequest and Redirect



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

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, but could not quite
get it to work I guess I'll investigate a bit further....

Thanks again!

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