Note that there are some explanatory texts on larger screens.

plurals
  1. POAsyncPostBack FileUpload on a ModalPopup
    text
    copied!<p>I am using a UpdatePanel, and my submit button is one of the triggers along with the clear button. But the problem is I have a FileUpload Control in the div. This is a modal popup, so it displays a form for a user to upload a little note. When I try to upload a file with AsyncPostBackTrigger it does nothing (which I have read about). My question is how do I not use the PostBackTrigger because I want to use the asyncpostbacktrigger because if an error occurs, then the Modal popup closes and the user doesnt know if the file was uploaded or not. What can I do?</p> <p>Code:</p> <pre><code>&lt;asp:Panel ID="addnotepanel" runat="server" style="/*display:none;*/" CssClass="addnotepanel"&gt; &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;&lt;ContentTemplate&gt; &lt;asp:FileUpload ID="FileUpload1" runat="server" /&gt; &amp;nbsp;&lt;br /&gt; &lt;/ContentTemplate&gt; &lt;Triggers&gt; &lt;asp:AsyncPostBackTrigger ControlID="ClrBtn" /&gt; &lt;asp:PostBackTrigger ControlID="SubmitBtn" /&gt; &lt;/Triggers&gt; &lt;/asp:UpdatePanel&gt; File: &lt;br /&gt; &lt;asp:Label ID="ErrorLabel" runat="server" Visible="False"&gt;&lt;/asp:Label&gt; &lt;br /&gt; &lt;asp:Button ID="Submitbtn" runat="server" Text="Submit" onclick="Submitbtn_Click" /&gt; &amp;nbsp;&lt;asp:Button ID="CnlBtn" runat="server" Text="Cancel" onclick="CnlBtn_Click" /&gt; &amp;nbsp;&lt;asp:Button ID="ClrBtn" runat="server" onclick="ClrBtn_Click" Text="Clear" /&gt; &amp;nbsp; &lt;/div&gt;&lt;/asp:Panel&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload