When a user select a tab on my site, I would like to store which tab they are on so that I can send them back there after the page refreshes. I have this at the moment (excuse the bad coding atm, I am testing the concept):
$("#index_0_li").click(function() {
<%= Session["SelectedIndex"] = "0" %>
});
$("#index_1_li").click(function() {
<%= Session["SelectedIndex"] = "1" %>
});
var index = <%= Session["SelectedIndex"] %>;
The problem is, because <%= %>
doesn't wait for the on click, the index is always being set to 1.
Does anyone have any ideas on how I can achieve what I am trying to do?
Thanks.