Hi, I am trying to create a link, which will onclick change a session variable like this
<a href="/Index" onclick="<% HttpContext.Current.Session["location"] = location;%>" >
<%=location%>
</a>
However, during processing the page the session changes on its own during generating each anchor element (with this onclick attribute). So I would like to create a javascript function like
<script type="text/javascript" >
function session(location) {
HttpContext.Current.Session["location"] = location;
}
</script>
Unfortunatelly, I don't know enough, so this doesn't seem working.. Any ideas? Thanks in advance