c# - asp.net ajax file upload causes full page refresh -
i'm trying test component i'm building. here's i'm trying do.
- upload file server without posting or refreshing page.
- i decided use ajaxfileupload control.
- the file uploads after saveas method called in backend, whole page getting refreshed weird reason.
here's code .aspx page:
`
<asp:updatepanel runat="server" updatemode="conditional"> <contenttemplate> <%= datetime.now %> </contenttemplate> </asp:updatepanel> <asp:updatepanel runat="server" updatemode="conditional"> <contenttemplate> <ajaxtoolkit:ajaxfileupload runat="server" id="ajaxfileupload1" onuploadcomplete="uploadcomplete" /> </contenttemplate> </asp:updatepanel>
`
here's backend code: `
protected void uploadcomplete(object sender, ajaxfileuploadeventargs e) { ajaxfileupload1.saveas(server.mappath("/" + e.filename)); }
`
the datetime.now block keep track of refreshes/postbacks.
Comments
Post a Comment