I've tried both of these:
<asp:HiddenField ID = "selectedHour" runat="server" Value="blahblah" />
<input type="hidden" id="myHour" name="hour" Value="blahblah" runat="server"/>
And I try to update it with Javascript:
<script type="text/javascript">
function addEventByClick(hour) {
document.getElementById("myHour").Value = hour;
alert(document.getElementById("myHour").Value);
document.getElementById("dummyButton").click();
}
</script>
which "works": the alert gives me the correct number.
Then, when I click submit it calls a C# method (called by clicking an asp.net component), which does this:
String h = myHour.Value;
//or
//String h = Request.Form["myHour"];
and this always returns "blahblah", that is, the initial value.
All of this stuff is in an update panel, but it's in the SAME update panel, all within the same ContentTemplate.
So why isn't it updating?
Edit: Thanks guys. I hate when I get 3 perfect answers, how do I know which one to check...