Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am developing a web app in vs 2010.
instead of using a button to logout from the webapp doing like this:
C#
protected void btn_logout_Click(object sender, EventArgs e)
      {
          Session["User"] = null;
          Response.Redirect("Index_Page.aspx");
      }


I want to use only a simple text and hyperlink but i dont know how to redirect to the Index_page form by clicking this text and making session["User"]=null.

What to do in this case?
Posted
Updated 25-Jan-13 10:47am
v3
Comments
BC @ CV 25-Jan-13 16:49pm    
Doesn't Response.Redirect work? You could also use Server.Transfer.
http://www.developer.com/net/asp/article.php/3299641/ServerTransfer-Vs-ResponseRedirect.htm[^]
Sandeep Mewara 26-Jan-13 7:19am    
Any specific reason why you want to do such thing?

1 solution

Hi Change your code like
Response.Redirect("Index_Page.aspx", false);
 
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