Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Posting to remote site to login and then redirect to site

Reply
Thread Tools

Posting to remote site to login and then redirect to site

 
 
BradM BradM is offline
Junior Member
Join Date: Sep 2006
Location: Perth, Western Australia
Posts: 9
 
      09-15-2006
I have a site that goes through a login process. Once logged in, you can then go to a specific page.

I can log into the site using a POST and then nagivate to the page, but the page has references to images etc on the site, so the page is incomplete and unusable.

I have tried logging on to the site using System.Net.WebRequest.Create(url) and then copying the cookies from System.Net.Cookies to System.Web.HttpCookie and copying the "Set-Cookie" from the header. Followed by a context.response.redirect(<site>). But the site comes back with session expired.

Have tried dynamic forms, but dont know how to keep control.
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.Write("<ht ml><head>");
System.Web.HttpContext.Current.Response.Write(stri ng.Format("</head><body onload=\"document.{0}.submit()\">", FormName));
System.Web.HttpContext.Current.Response.Write(stri ng.Format("<form name=\"{0}\" method=\"{1}\" action=\"{2}\" >", FormName, Method, Url));

for (int i = 0; i < oNameCollection.Keys.Count; i++)
{
System.Web.HttpContext.Current.Response.Write(stri ng.Format("<input name=\"{0}\" type=\"hidden\" value=\"{1}\">",
oNameCollection.Keys[i], oNameCollection[oNameCollection.Keys[i]]));
}

System.Web.HttpContext.Current.Response.Write("</form>");
System.Web.HttpContext.Current.Response.Write("</body></html>");
System.Web.HttpContext.Current.Response.End();
}
 
Reply With Quote
 
 
 
 
BradM BradM is offline
Junior Member
Join Date: Sep 2006
Location: Perth, Western Australia
Posts: 9
 
      10-11-2006
Does anyone have any ideas?
 
Reply With Quote
 
 
 
 
BradM BradM is offline
Junior Member
Join Date: Sep 2006
Location: Perth, Western Australia
Posts: 9
 
      05-30-2007
I am still hoping that someone might have some ideas on how to do this.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help. SessionID is x then y then x then y BodiKlamph@gmail.com ASP General 0 09-03-2005 03:02 PM
How does Hotmail login redirect to SSL automatically and then back? Jacob ASP .Net 0 07-08-2004 05:37 PM
How does Hotmail login redirect to SSL automatically and then back? Jacob ASP .Net 0 07-08-2004 05:30 PM
How does Hotmail login redirect to SSL automatically and then back? Jacob ASP .Net 0 07-08-2004 05:29 PM
Basic Q - Response.Redirect, all redirect to first Response.Redirect statement Sal ASP .Net Web Controls 1 05-15-2004 03:46 PM



Advertisments