Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
1.24/5 (3 votes)
See more:
how to store return url after login??
Posted
Updated 8-Apr-23 1:56am
Comments
joginder-banger 19-Mar-14 6:37am    
what type of url you store and what's you want plz explain for better understand.
Member 10276220 19-Mar-14 6:40am    
i have a page in where there is a button,after clciking it,the page will be redirected at login page & after login it will redirect at the same page,,,
my URL is "Event.aspx?EventID=3"

1 solution

C#
protected void Login_Click()
{
    if (Request.QueryString["ReturnURL"] != null)
    {
        Response.Redirect(Request.QueryString["ReturnURL"]);
    }
    else
    {
        Response.Redirect("/Home.aspx");
    }

}


for more information let's try this link [^]
 
Share this answer
 
Comments
Member 10276220 19-Mar-14 6:42am    
thanx joginder...but i got an error..."Thread was being aborted."
what to do now???
joginder-banger 19-Mar-14 6:44am    
share you code for better understand what's u try
Member 10276220 19-Mar-14 6:51am    
if (Session["UserID"] == null)
{
Response.Redirect("Login.aspx?ReturnURL="+HttpContext.Current.Request.Url.AbsoluteUri);
}

if (Request.QueryString["ReturnURL"] != null)
{
Response.Redirect(Request.QueryString["ReturnURL"]);
}
Member 15854629 5-Dec-22 10:29am    
this looks not organised look u want to redirect to a page why you are writing a whole request inside it and not a simple page that he will redirect to it

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