I have a problem of setting value on HiddenFiled with javascrip on ASP.NET my HiddenFiled code is:
<asp:HiddenField ID="hidden" Value="before" runat="server" />
my JS code in ASP.NET is:
function HandleIT(id) {
alert(document.getElementById('<%=hidden.ClientID %>').value);
document.getElementById('<%=hidden.ClientID %>').value = "test";
alert(document.getElementById('<%=hidden.ClientID %>').value);
<%Session["search"] = hidden.Value;%>
window.location.assign("Search.aspx");
}
so the first alert show me "before" and the second one show me "test". so far so good. but when it goes to Search.aspx and i am using Session["search"] its showing me "before" any idea why is it happaning?