could not access hiddenfield
-
i have a control in javascript on click of a button i am function menuclicked() { if (myname == 'aruna') { document.getElementById("<%=h1.ClientID%>").value="hidden"; alert(document.getElementById("<%=h1.ClientID%>").value); } } on code file i am accessing the hidden field as if (!IsPostBack) { str =h1.Value ; } but i am getting the value as null. Can anyone please help me with this.
-
i have a control in javascript on click of a button i am function menuclicked() { if (myname == 'aruna') { document.getElementById("<%=h1.ClientID%>").value="hidden"; alert(document.getElementById("<%=h1.ClientID%>").value); } } on code file i am accessing the hidden field as if (!IsPostBack) { str =h1.Value ; } but i am getting the value as null. Can anyone please help me with this.
Are you getting the text "hidden" in the javascript alert?
-
Are you getting the text "hidden" in the javascript alert?
yes but could not get in code file.
-
yes but could not get in code file.
Disclaimer - I have never used asp:HiddenField, I prefer the HTML input field. But I'm assuming HiddenField and input type hidden work the same way. Is there any other post back happening between the javascript and the server code execution? I mean are you posting the form to the server from the javascript or are you doing it on different events?
-
Disclaimer - I have never used asp:HiddenField, I prefer the HTML input field. But I'm assuming HiddenField and input type hidden work the same way. Is there any other post back happening between the javascript and the server code execution? I mean are you posting the form to the server from the javascript or are you doing it on different events?