Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't access .NET control from AsyncFIleUpload.OnUploadCompleted code behind
    primarykey
    data
    text
    <p>I am using an AJAX Toolkit AsyncFileUpload as follows...</p> <pre><code> &lt;p&gt; &lt;asp:Label runat="server" Text="Choose a webstock file to upload..." ID="uploadResult" /&gt; &lt;asp:Button ID="btnImport" Text="Import Data to Website &amp;raquo;" OnClick="importData" runat="server" Visible="false" /&gt; &lt;/p&gt; &lt;asp:AsyncFileUpload ID="afuStockImport" runat="server" OnUploadedComplete="uploadComplete" OnClientUploadError="uploadError" OnClientUploadStarted="StartUpload" OnClientUploadComplete="UploadComplete" Width="400px" UploaderStyle="modern" UploadingBackColor="#b9b9b9" CompleteBackColor="#00FF00" ErrorBackColor="#FF0000" ThrobberID="myThrobber" ClientIDMode="AutoID"/&gt; &amp;nbsp; &lt;asp:Label runat="server" ID="myThrobber" style="display:none;" &gt; &lt;img align="absmiddle" alt="" src="adminimages/uploading.gif" /&gt; &lt;/asp:Label&gt; </code></pre> <p>I am trying to access the btnImport control to make it visible on success of upload, but accessing it from the uploadComplete procedure in the code behind does nothing....</p> <pre><code> protected void uploadComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e) { try { //upload file to web file system System.Threading.Thread.Sleep(5000); if (afuStockImport.HasFile) { string strPath = Server.MapPath("~/admin/stockfiles/") + Path.GetFileName(afuStockImport.PostedFile.FileName); afuStockImport.SaveAs(strPath); btnImport.Visible = true; } } catch (Exception ulEx) { //Error message } } </code></pre> <p>Any help would be appreciated. </p> <p>Cheers, Ben</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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