Cannot get Asyncfileupload to fire UploadComplete event... :(http://forums.asp.net/t/1597844.aspx/1?Cannot+get+Asyncfileupload+to+fire+UploadComplete+event+Fri, 19 Nov 2010 14:52:50 -050015978444056650http://forums.asp.net/p/1597844/4056650.aspx/1?Cannot+get+Asyncfileupload+to+fire+UploadComplete+event+Cannot get Asyncfileupload to fire UploadComplete event... :( <p>hey everyone!</p> <p>I cannot get the asyncfileupload to fire the uploadcomplete event at all.&nbsp;</p> <p>I did a test:</p> <p></p> &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp;Protected Sub AsyncFileUpload1_UploadedComplete(ByVal sender As Object, ByVal e As AjaxControlToolkit.AsyncFileUploadEventArgs) Handles AsyncFileUpload1.UploadedComplete&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Dim currentUser As MembershipUser = Membership.GetUser()&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Dim currentUserId As Guid = CType(currentUser.ProviderUserKey, Guid)&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;errorLabel.Text = &quot;Test&quot;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&nbsp;&nbsp; &nbsp;End Sub&lt;/div&gt; <p></p> <p>&nbsp;&nbsp; &nbsp;Protected Sub AsyncFileUpload1_UploadedComplete(ByVal sender As Object, ByVal e As AjaxControlToolkit.AsyncFileUploadEventArgs) Handles AsyncFileUpload1.UploadedComplete</p> <p>&nbsp;&nbsp; &nbsp; &nbsp; errorLabel.Text = &quot;Test&quot;</p> <p>&nbsp;&nbsp; &nbsp;End Sub</p> <p></p> <p><br> </p> <p>and... nothing.&nbsp;</p> <p>The background turns green, my throbber activates successfully.. but then, I get nothing. It doesnt even make it to the uploadedComplete event.&nbsp;</p> <p>I also did the same test in the error event.. and still nothing. Any ideas??</p> <p></p> 2010-09-01T17:46:16-04:004056955http://forums.asp.net/p/1597844/4056955.aspx/1?Re+Cannot+get+Asyncfileupload+to+fire+UploadComplete+event+Re: Cannot get Asyncfileupload to fire UploadComplete event... :( <p>I 'think' this may be because the .js code is reliant on the browser being capable of HTML5 (this is one of the new DOM events from memory).</p> <p><br> </p> <p>What browser are you testing with?<br> </p> 2010-09-01T21:35:52-04:004057104http://forums.asp.net/p/1597844/4057104.aspx/1?Re+Cannot+get+Asyncfileupload+to+fire+UploadComplete+event+Re: Cannot get Asyncfileupload to fire UploadComplete event... :( <p>Chrome. and IE8</p> 2010-09-02T01:19:42-04:004057230http://forums.asp.net/p/1597844/4057230.aspx/1?Re+Cannot+get+Asyncfileupload+to+fire+UploadComplete+event+Re: Cannot get Asyncfileupload to fire UploadComplete event... :( <p>Please refer this</p> <p><a href="http://forums.asp.net/p/1479689/3461051.aspx">http://forums.asp.net/p/1479689/3461051.aspx</a></p> <p><a href="http://forums.asp.net/p/1546913/3783061.aspx">http://forums.asp.net/p/1546913/3783061.aspx</a></p> <p><a href="/p/1576297/3959887.aspx">http://forums.asp.net/p/1576297/3959887.aspx</a>&nbsp;</p> 2010-09-02T03:34:18-04:004058281http://forums.asp.net/p/1597844/4058281.aspx/1?Re+Cannot+get+Asyncfileupload+to+fire+UploadComplete+event+Re: Cannot get Asyncfileupload to fire UploadComplete event... :( <p>I enabled some trace debugging, and here is the streamed error:</p> <p><br> </p> <p></p> &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;Webpage error details&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.5; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E; AskTbBT5/5.8.0.12304)&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;Timestamp: Thu, 2 Sep 2010 14:50:20 UTC&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;Message: '&#36;common' is null or not an object&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;Line: 1&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;Char: 4137&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;Code: 0&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;URI: http://dmbdating.com/dmbdating/ScriptResource.axd?d=oGfO0n1SoeuBwgSTL_fgNNvEtyaZoqgTmFvtXOlrsq9x0PaD7M3gV2SO2-R5Y2mKHSVHULUbLJbsnD4tn1KzAQ2&amp;t=ffffffff83c1d743&lt;/div&gt; &lt;div style=&quot;position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot; id=&quot;_mcePaste&quot;&gt;&lt;/div&gt; <p></p> <p>Webpage error details</p> <p><br> </p> <p>User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.5; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E; AskTbBT5/5.8.0.12304)</p> <p>Timestamp: Thu, 2 Sep 2010 14:50:20 UTC</p> <p>Message: '&#36;common' is null or not an object</p> <p>Line: 1</p> <p>Char: 4137</p> <p>Code: 0</p> <p>URI: http://EDITED.COM/EDITED/ScriptResource.axd?d=oGfO0n1SoeuBwgSTL_fgNNvEtyaZoqgTmFvtXOlrsq9x0PaD7M3gV2SO2-R5Y2mKHSVHULUbLJbsnD4tn1KzAQ2&amp;t=ffffffff83c1d743</p> <p>If this helps.. let me know. Cause Im stuck. lol.&nbsp;</p> <p></p> <p></p> 2010-09-02T14:52:04-04:004059308http://forums.asp.net/p/1597844/4059308.aspx/1?Re+Cannot+get+Asyncfileupload+to+fire+UploadComplete+event+Re: Cannot get Asyncfileupload to fire UploadComplete event... :( <p>Hi,</p> <p>Please&nbsp;make sure you are setting&nbsp;right for the Asyncfileupload:</p> <pre class="prettyprint">&lt;script type=&quot;text/javascript&quot;&gt; function fillCell(row, cellNumber, text) { var cell = row.insertCell(cellNumber); cell.innerHTML = text; cell.style.borderBottom = cell.style.borderRight = &quot;solid 1px #aaaaff&quot;; } function addToClientTable(name, text) { var table = document.getElementById(&quot;&lt;%= clientSide.ClientID %&gt;&quot;); var row = table.insertRow(0); fillCell(row, 0, name); fillCell(row, 1, text); } function uploadError(sender, args) { addToClientTable(args.get_fileName(), &quot;&lt;span style='color:red;'&gt;&quot; &#43; args.get_errorMessage() &#43; &quot;&lt;/span&gt;&quot;); } function uploadComplete(sender, args) { var contentType = args.get_contentType(); var text = args.get_length() &#43; &quot; bytes&quot;; if (contentType.length &gt; 0) { text &#43;= &quot;, '&quot; &#43; contentType &#43; &quot;'&quot;; } addToClientTable(args.get_fileName(), text); } &lt;/script&gt; &lt;div class=&quot;demoarea&quot;&gt; &lt;div class=&quot;demoheading&quot;&gt;AsyncFileUpload Demonstration&lt;/div&gt; Click '&lt;i&gt;Select File&lt;/i&gt;' for asynchronous uploading. &lt;br /&gt;&lt;br /&gt; &lt;ajaxToolkit:AsyncFileUpload OnClientUploadError=&quot;uploadError&quot; OnClientUploadComplete=&quot;uploadComplete&quot; runat=&quot;server&quot; ID=&quot;AsyncFileUpload1&quot; Width=&quot;400px&quot; UploaderStyle=&quot;Modern&quot; UploadingBackColor=&quot;#CCFFFF&quot; ThrobberID=&quot;myThrobber&quot; /&gt; &lt;asp:Label runat=&quot;server&quot; ID=&quot;myThrobber&quot; style=&quot;display:none;&quot; &gt;&lt;img align=&quot;absmiddle&quot; alt=&quot;&quot; src=&quot;uploading.gif&quot; /&gt;&lt;/asp:Label&gt; &lt;div&gt;&lt;strong&gt;The latest Server-side event:&lt;/strong&gt;&lt;/div&gt; &lt;asp:Label runat=&quot;server&quot; Text=&quot; &quot; ID=&quot;uploadResult&quot; /&gt; &lt;br /&gt;&lt;br /&gt; &lt;div&gt;&lt;strong&gt;Client-side events:&lt;/strong&gt;&lt;/div&gt; &lt;table style=&quot;border-collapse: collapse; border-left: solid 1px #aaaaff; border-top: solid 1px #aaaaff;&quot; runat=&quot;server&quot; cellpadding=&quot;3&quot; id=&quot;clientSide&quot; /&gt; &lt;/div&gt;</pre> <p><br> &nbsp;</p> 2010-09-03T06:03:50-04:004130238http://forums.asp.net/p/1597844/4130238.aspx/1?Re+Cannot+get+Asyncfileupload+to+fire+UploadComplete+event+Re: Cannot get Asyncfileupload to fire UploadComplete event... :( <p>I'm self-taught, so my terminology might be a little off, but I'll try to explain this prob.</p> <p>Basically some people are forgetting this is an ASYNCHRONOUS uploader, using AJAX, so only the uploader is posting back to the server.</p> <p>When the uploader completes and fires off the server-side onuploadedcomplete event, it cannot update the rest of the page (but you can do server-side things like save, rename, move the file, make a DB entry, etc.). That is why there are client-side/javascript events you can specify (OnClientUploadError, OnClientUploadStarted, OnClientUploadComplete) with it that if you want anything to happen on the client side (display success text, change graphics, etc.) you have to do it using javascript.</p> <p>Same thing when you try to fire off some javascript from a server-side button event when using AJAX.</p> <p>Solution? You might want to remove AJAX from the page (remove updatepanel) and see if you can get it to work then. Of course then you lose the benefits of AJAX and asynchronous stuff =/</p> <p>Hope this helps.</p> 2010-10-19T03:41:49-04:004176271http://forums.asp.net/p/1597844/4176271.aspx/1?Re+Cannot+get+Asyncfileupload+to+fire+UploadComplete+event+Re: Cannot get Asyncfileupload to fire UploadComplete event... :( <p>Had the same issue. </p> <ul> <li>download asp ajax toolkit 3.5 ( you will notice it shows 3.5.0.4 and talks about version 4 in your browser),&nbsp;</li><li>remove all dll from your project&nbsp;</li><li>remove component in palette to make sure you are not using old ones</li><li>add it again (browse to the ajax dll) and add all object, it would happen you change version of your Ajax toolkit.</li><li>in that version <u>scriptmanager does not exist anymore</u>, instead you have <b>ToolKitScriptmanager</b>, drag one and you won't get the error anymore. (make sure you only have one, clear all existing in master page or other)</li></ul> 2010-11-19T14:52:50-05:00