Click here to Skip to main content
15,885,914 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In my web application contains the list of Url also have the Url login details information with control name. when i click the Url in the list i want to open the url in new tab also login automatically.


please help me...
Posted

when i click the Url in the list i want to open the url in new tab also login automatically.
If it's a Forms Authentication, pass the username & password as querystring in the URL.

Then, all you need to do in your page load is something like:
C#
string username = Request.QueryString["username"].ToString();
   string password = Request.QueryString["password"].ToString();
   if (Membership.ValidateUser(username , password))
   {
         FormsAuthentication.SetAuthCookie(username , true);
         Response.Redirect("~/");
   }


Other way could be to use HttpWebReqest and HttpWebResponse, pass appropriate parameters of the page while crawling using code behind.
See these samples:
VBASPNETAutoLogin Overview[^]
HttpWebRequest Post method[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900