I have a ajax file upload inside my update panel to upload the file immediately after the user selects a file to upload. During the file upload in btnVidUpload_Click I assign the file name to the hidden field which is also inside the update panel. Then when I click Submit Send_Click tries to get the value from the hidden field, but the hidden field is empty, why is the hidden field losing its value, cant it retain the value during post back or is there a way to store the value without using session. thanks
<asp:AsyncFileUpload ID="AFU_Video" OnUploadedComplete="btnVidUpload_Click"
runat="server" UploaderStyle="Traditional" ThrobberID="aajaxLoader" />
<asp:HiddenField ID="Hidd_VideoLoc" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:ImageButton ID="btn_Send" Text="Submit" runat="server" OnClick="Send_Click" />
The
AsyncFileUploadinternally uses an iFrame to render theFileUploadcontrol.That is the reason why it seems to lose it’s value.
You need to use the Session in
btnVidUpload_Click.Own answer on a similar question: https://stackoverflow.com/a/8495986/284240