i am using AjaxFileUpload
in ASP.NET 4.0
website. The problem is that when i upload a file its UploadComplete
fires which causes a postback to page. on every postback
caused by AjaxFileUpload
the Ispostback
property is False
which should be True
. What is the reason. I checked it in the updatePanel
and without it. It has no affect at it. Here is the
<ajax:AjaxFileUpload ID="AjaxFileUpload1" ContextKeys="fred"
AllowedFileTypes="jpg,jpeg,png,gif" MaximumNumberOfFiles="3" runat="server"
OnUploadComplete="AjaxFileUpload1_UploadComplete" />
To detect postback from the AjaxFileUpload use this control's property: AjaxFileUpload.IsInFileUploadPostBack
. The IsPostBack
property doesn't works because this control submits not to the same page where is was rendered but to hidden frame instead so it's the first time for frame it loading on server. See more in AjaxControlToolkit sources: AjaxControlToolkit AjaxFileUpload
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With