Note that there are some explanatory texts on larger screens.

plurals
  1. POAjaxFileUpload inside a Panel not working
    text
    copied!<p>Hello I'm having trouble getting the AjaxFileUpload control to work properly. I have it working properly on a different page, using identical code, but not inside of a panel on this page. It functions properly and allows me to select files and hits the 'OnUploadComplete' function, however it is crashing on the .SaveAs giving me NullReferenceException. I put the ghostupload control at the start of the page at the recommendation after finding others with similar problems and this is necessary or the control doesn't work at all.</p> <p>aspx code (outside panel)</p> <pre><code>&lt;div style="display:none"&gt; &lt;AjaxControlToolkit:AjaxFileUpload ID="ghostAjaxFileUpload" runat="server" OnUploadComplete="AjaxFileUpload_UploadComplete" /&gt;&lt;/div&gt; </code></pre> <p>aspx code (inside panel)</p> <pre><code>&lt;AjaxControlToolkit:AjaxFileUpload ID="ajaxupload1" runat="server" ThrobberID="loader123" AllowedFileTypes="jpg,jpeg" MaximumNumberOfFiles="2" OnUploadComplete="AjaxFileUpload_UploadComplete" /&gt;&lt;asp:Image id="loader123" ImageUrl="images/loading.gif" Style="display:None" runat="server" /&gt; </code></pre> <p>aspx.cs code</p> <pre><code>protected void AjaxFileUpload_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { //...other logic/file checking (working fine) ajaxupload1.SaveAs(appSession.GlobalImageFolder + appSession.GlobalProductImageFolder + filename); } </code></pre> <p>Been working on this one all day and it's got me stumped! I really like the AjaxFileUpload so I'm hoping I won't have to resort to a different upload control. Really appreciate any help on this one!</p> <p>Cheers, Jordan</p>
 

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