Q:

How to clear the session variable in asp.net design source file

Session["pageIndex"] this is my variable which is used in all aspx.cs pages
I used 
$('#btn_click').click(function(){
sessionStorage.removeItem('pageIndex');
)}; 

to clear the session variable in design source file but it doesn't works
help me thanks in advance

A:

I recommend you throw the page number into the query string, then in the Page_Load event, you check for it. If its there, you go to that page directly, otherwise you load the first page.
This should support browser back button functionality taking you to the correct page. 
The issue you're experiencing is that ASP.NET is letting you change the page content without changing the url. 

