why do i lose my hidden field value?
<p>I have some hidden fields on my page, all of which work fine apart from one.  I am setting the value in document.ready, before calling buildGrid() :</p>

<pre><code> $(document).ready(function() {

    $.ajax(
    {
        type: "POST",
        url: "/CDServices.asmx/GetWeekEndingDates",
        data: "{}",
        dataType: "json",
        contentType: "application/json; charset=utf-8",

        success: function(msg) {

            //store default dates in hidden fields
            $("#&lt;%=hdnCurrentDate.ClientID%&gt;").val(msg.d.CurrentDate);
            $("#&lt;%=hdnLastWeekEndingDate.ClientID%&gt;").val(msg.d.LastWeekEndingDate);
        }
    });

    buildGrid();

});
</code></pre>

<p>Yet in buildGrid, the value in the hidden field is empty :</p>

<pre><code> function buildGrid() {

    alert($("#&lt;%=hdnLastWeekEndingDate.ClientID%&gt;").val());
</code></pre>

<p>I call other functions on button clicks where the hidden field value is picked up fine, why does the value disappear here?</p>
