Update a value of a hidden field after uploading an image with AsyncFileUpload control
<p>I upload an image with <code>AsyncFileUpload</code> control. </p>

<p>On <code>UploadedComplete</code> I try to assign some value to a hidden field using <code>ScriptManager.RegisterClientScriptBlock</code>.</p>

<p>html:</p>

<pre><code>&lt;asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" CombineScripts="false"&gt;
&lt;/asp:ToolkitScriptManager&gt; 
&lt;div&gt;
    &lt;asp:AsyncFileUpload ID="uplImage" OnUploadedComplete="uplImage_UploadedComplete"
        runat="server" Width="285px" ClientIDMode="AutoID" EnableViewState="false" /&gt;
    &lt;asp:HiddenField runat="server" ID="hdnTempImgNm" /&gt;      
    &lt;input type="button" id="btnCheck" value="Check" class="btnCheck" /&gt;
&lt;/div&gt;
</code></pre>

<p>event handler:</p>

<pre><code>protected void uplImage_UploadedComplete(object sender, EventArgs args)
    {
        //1 case:
        //ScriptManager.RegisterClientScriptBlock(uplImage, uplImage.GetType
        //  (), "myscript",
        //String.Concat(" $(document).ready(function(){$('input:hidden
        //   [name*=\"hdnTempImgNm\"]').val('Some value');})"),true);

        //2 case:
        ScriptManager.RegisterClientScriptBlock(uplImage, uplImage.GetType
        (), "myscript",
        String.Concat("top.document.getElementById('" + hdnTempImgNm.ClientID 
         + "').value='Some value'; "),true);
    }
</code></pre>

<p>javascript:</p>

<pre><code> &lt;script&gt;
    $(document).ready(function () {    
        $('.btnCheck').click(function (e) {
            alert($('input:hidden[name*="hdnTempImgNm"]').val());
        });
    })
&lt;/script&gt;
</code></pre>

<p>In the 1 case when I click on the Check button to check a hidden filed value I get an empty value. But in the 2 case where I use <code>top.document</code> I get the right value i.e. "Some value".</p>

<p>My questions are:
1. Why the 1 case doesn't work? 
2. How can I rewrite the 2 case using jquery (i.e. how to write top.document)?</p>

<p>Thank you</p>
