AsyncFileUpload postback causes double upload

前端 未结 6 1738
伪装坚强ぢ
伪装坚强ぢ 2020-12-07 02:32

I implemented the AsyncFileUpload control on a web page. This web page requires uploaded files to appear in a GridView.
The GridView

6条回答
  •  被撕碎了的回忆
    2020-12-07 03:21

    There is a simpler solution

    @@t0x1n3Himself the solution u gave is very simple but does not work

    surround the AsyncFileUpload with an update panel name it UpdatePanelAFU then in the UpdatePanelAFU do as the following :

     protected void AsyncFileUpload_UpdatePanelAFU(object sender,AjaxControlToolkit.AsyncFileUploadEventArgs e)
    {
    
        if (Request.Params.Get("__EVENTTARGET") != "UpdatePanelAFU")
            return;
    ..... rest of the code 
    }
    

    enjoy!

提交回复
热议问题