Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
protected void Page_Load(object sender, EventArgs e)
{
if (Session["user"].ToString() == "")
{
Response.Redirect("~/Default.aspx");
}
} 


But not working?
please help me?
Thanks
Posted

1 solution

Try this :)

C#
if (Session["user"] == null)
{
Response.Redirect("Default.aspx"); //If your page in same directory
}



& make sure your session name is same....
 
Share this answer
 
v2
Comments
Member 10506503 5-Jun-14 10:40am    
if (Session["user"] == null)
{
Response.Redirect("Default.aspx"); //If your page in same directory
}
same directoty

but not working sir
Not working means !! Is there any issue?

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