c# - Update Panel AsyncPostBack and PostBack triggers -
i have page in of html generated client side script (jquery). added server side asp.net file control upload files server.
now files getting uploaded on button click, causes postback , textboxes company name, street name, city client etc lost, generated jquery.
i put upload portion in updatepanel , registered asyncpostback trigger, not getting httpcontext object @ code-behind. turned async full postback using postbacktrigger things became same before(i.e. without update panel).
now have 2 questions people: - use of update panel if behaves in same way page without update panel. (postbacktrigger) - should above problem?
code:
<asp:updatepanel id="uploadupdatepanel" runat="server"> <contenttemplate> <input id="filefield" type="file" runat="server" multiple="multiple" /> <asp:button id="uploadbutton" runat="server" text="upload documents" onclick="uploadbutton_click" /> </contenttemplate> <triggers> <asp:asyncpostbacktrigger controlid="uploadbutton" /> <%--<asp:postbacktrigger controlid="uploadbutton" />--%> </triggers> </asp:updatepanel>
basically, fileupload controls don't work in updatepanels. i've run issue before , far know, there's no way around it. you're going have accept full postback , work on saving user inputs.
Comments
Post a Comment