1

I want to close my session while pressing on the text in the list. I don't really know how to do it. It is ASP.net and its need to be when I press the last link.

<div id="container">
  <div id="sidebar">
    <ul id="nav">
      <li><a class="selected" href="AdminPage.aspx">Home</a></li>
      <li><a href="AdminRegels.aspx">Regels</a></li>
      <li><a href="AdminAfspr.aspx">Afspraken</a></li>
      <li><a href="AdminGrenzen.aspx">Grenzen</a></li>
      <li><a href="AdminUser.aspx">Users</a></li>
      <li><a href="../Web/Home.aspx">Uitloggen</a></li>
    </ul>
  </div>
Idan
  • 5,405
  • 7
  • 35
  • 52

1 Answers1

0

The user would click on the AdminPage.aspx link and then you can clear the session in the Page_Load event.

protected void Page_Load(object sender, EventArgs e)
{
   // clear or abandon ...
}

It's not clear whether you want to use Session.Clear or Abandon. See the following SO answer on which one is suitable for your requirement.

In ASP.NET, when should I use Session.Clear() rather than Session.Abandon()?

William Xifaras
  • 5,212
  • 2
  • 19
  • 21