473,395 Members | 1,440 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,395 software developers and data experts.

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.

Nov 19 '05 #1
3 2774
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.

"Hawksey" <Pa*********@gmail.com> wrote in message
news:11********************@f14g2000cwb.googlegrou ps.com...
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.

Nov 19 '05 #2
When using HttpWebRequest is automatically handles redirects, unless you
disable it with the AllowAutoRedirect=false.

-Brock
DevelopMentor
http://staff.develop.com/ballen
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.


Nov 19 '05 #3
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!

Hawksey wrote:
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.


Nov 19 '05 #4

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

Similar topics

2
by: Nick Jacobsen | last post by:
I am using HTTPWebRequest to connect to a server which requires authentication, then responds with a 302 redirect message, and redirects to DIFFERANT server, which also requires authentication (the...
4
by: Vivek | last post by:
how to add the headers to httpwebrequest/httpwebresponse from .net code ?
3
by: Hardik Shah | last post by:
Hi, I am calling an ASP.Net page from an ASP classic application but need the .Net page to have access to ASP classic's session variables. I am using HTTPWebRequest to call ASP classic page...
2
by: TK | last post by:
I have a trouble to get web resopnse from an aspx page which is secured by Forms Authentication with custom user account database. My client application is a console application but not a browser....
6
by: Oliver | last post by:
I have a very wired problem requesting one specific url from within my application. I have struggeled with this for 5 hours now, and searched google withour any luck, so i hope that someone are...
0
by: Alex Papadimoulis | last post by:
Hey Group, I'm in the process of converting an ASP-based site to an ASP.NET site and built a control that wraps around an ASP page. The control simply does a GET to the same server to render the...
0
by: Alex Papadimoulis | last post by:
Hey Group, I'm in the process of converting an ASP-based site to an ASP.NET site and built a control that wraps around an ASP page. The control simply does a GET to the same server to render the...
0
by: barrybevel | last post by:
Hi, I'm trying to login to the www.vodafone.ie website using HttpWebRequest. It works fine with IE/Firefox and the .NET Web Control too, just not with my code. I think it's a redirect 302...
2
by: bepnewt | last post by:
Hello! I'm trying to connect to different sites using an HttpWebRequest object and some of them return an Error 400. If you navigate to it in a normal browser, it works fine. This is an example...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.