I am very confused when it comes to using asp:hiddenfields .
Here is my code:
<asp:HiddenField ID ="CurrentAnswer" runat="server" Value="-1" />
and in a js file loaded in that html page:
$(document).ready(function () {
alert(document.getElementById("<%= CurrentAnswer.ClientID %>"));
});
This value returns null. It will work if i put it into the same asp webform, but not in a separate js file.I have seen this done on just about every page I looked at. here for example. I have no idea why this is not working. Any thoughts?