Dines87 :
<input type="hidden" id="hdnMiddlediv" runat="server" /> <script type="text/javascript"> document.getElementById('<%=hdnMiddlediv.ClientID %>').value='test'; </script>
While page load i want access this value
It is clear that you will not see the value of this hidden field at first occurrence of page
OnLoad
because the order of execution is
something like this
:
page OnLoage (server) --- send output to client ---> client scripts run(hidden field is set here because it is a client side script) ---> page post back ---> page OnLoad (server)
To determine its a first
OnLoad
or it is not , use
IsPostBack
boolean variable in
OnLoad
event handler.
Hope it helps.