c# - asp.net ajax file upload causes full page refresh -


i'm trying test component i'm building. here's i'm trying do.

  1. upload file server without posting or refreshing page.
  2. i decided use ajaxfileupload control.
  3. 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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -