tags:

views:

43

answers:

1

I am facing a problem.

I maintain a session after login like session["UserID"] and every page is locked with this session like

if(session["UserID"] == "")
{
Response.redirect("./loginpage.aspx");
}
else
{
// page working code
}

Problem is that i am saving the data then redirect the page after saving session was automatically clear and the page is redirect to login page.

in web config file i write this line

<sessionState mode="InProc"  timeout="60">

how i solved this problem to stay in session state on save data and redirecting the same page.

A: 

you can use a Session.Abandon() call before redirecting to loginpage.aspx

Midhat