title: set hidden field value in document.ready and get its value in pageload event
body: <p>I am trying to set hidden fied value in document.ready function and get it in PageLoad event but its value always empty where I am wrong please suggest me.
  My javascript code is
        </p>
  
  <pre><code>    $(document).ready(function () {
          if (document.getElementById('&lt;%=hdnMiddlediv.ClientID %&gt;').value = '')
          { document.getElementById('&lt;%=hdnMiddlediv.ClientID %&gt;').value = 'test'; }
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>c#</p>
  
  <pre><code>    protected void Page_Load(object sender, EventArgs e)
      {
          string val = hdnMiddlediv.Value;
          if (!IsPostBack)
          {
              string val2 = hdnMiddlediv.Value;
  
          }
      }
  </code></pre>