3

Closed

AsyncFileUpload control - script not responding in FireFox when width property set

description

(originally reported by alansingfield)

If you have an AsyncFileUpload control within a <DIV> that constrains its width, and set the Width attribute of the control to wider than its container, the script never completes in Firefox.
<div style="width:100px"> <asp:AsyncFileUpload runat="server" Width="1000px"/> </div> The problem is caused by this part of the script:

_app_onload: function(sender, e) {
...
if (Sys.Browser.agent == Sys.Browser.Firefox) {
this._inputFile.size = 0;
var width = this._inputFile.offsetWidth;
this._inputFile.style.width = "";
while (this._inputFile.offsetWidth < width) {
this._inputFile.size++;

The final while() loop never terminates.

I suggest that a sanity check is put in there - if the offsetWidth does not change value after incrementing size, the loop should terminate.

Alan Singfield.
Closed Apr 29, 2011 at 4:13 AM by Superexpert
We were unable to reproduce this error in Firefox 3.5, 3.6 and 4. If you reproduce the error, please post a code sample and the exact version of the Firefox browser and version of the Ajax Control Toolkit.

comments

Mohammad_O_S wrote Aug 15, 2013 at 7:16 AM

it is happened to me

ajaxToolkit version="7.0725"

targetFramework="net40"

<ajaxToolkit:ToolkitScriptManager runat="server" EnablePartialRendering="true" CombineScripts="false" />

in master page

<ajaxToolkit:AsyncFileUpload ID="UploadedFile" OnClientUploadComplete="FileUploadCompleate"
                                    OnClientUploadStarted="FileUploadStarted" OnClientUploadError="FileUploadError"
                                    runat="server" PersistFile="True" UploadingBackColor="#3399FF" Width="235px"  />

in the page

jquery 1.7.2

firefox 22

vs2012


please help

ravalon wrote Dec 4, 2013 at 5:31 PM

I have the same problem.... when i have a page with an AsyncFileUpload i obtain script error and infinite loop in firefox...

It happen (in my observation) from version 25, before of this i never seen this error...

It not happen with Chrome....

I use .NET Framework 4.0

Someone have a solution for this problem ?? Please, i have to solve because of insoddisfaction request from who use my works....
...if someone have a solution could write me please ?

Superexpert wrote Dec 4, 2013 at 9:32 PM

We're investigating it now...

shamal7 wrote Dec 19, 2013 at 8:39 AM

Hi we are also having the exact problem for last 4 months in Firefox. When I debug the issue it shows stuck in the following block.
if (Sys.Browser.agent == Sys.Browser.Firefox) {
this._inputFile.size = 20;
var width = this._inputFile.offsetWidth;
this._inputFile.style.width = "";
while (this._inputFile.offsetWidth < width) {
    this._inputFile.size++;  
}
}

Values shown as
width: 359
this._inputFile.offsetWidth: 235
this._inputFile.size: 1742518

I would really appreciate a fix for this as our customers are already annoyed by now.