I am using the new version of AjaxControlToolkit and I found a logical error, but I am trying to find the best way to fix this, by Saturday, so that the program works on IE.
This problem has only an error in IE, it works on Firefox3.5.
I have an AsyncFileUpload component in a tab that does not appear to be visible when this function is executed, so the offset width is zero.
The problem is the file AsyncFileUpload.pre.js, the function _app_onload, and this line:
this._innerTB.style.width = (this._inputFile.offsetWidth - 107) + "px";
I do not want to compile it from the source, but this may be the best option, so I can fix the error.
But this will probably be my fix:
this._innerTB.style.width = ((this._inputFile.offsetWidth == 0) ? 200 : this._inputFile.offsetWidth) - 107) + "px";
But I do not know if there is a better solution.
I could just write a new prototype function in my javascript class and just fix a logical error that is better than recompiling. If I fix this in the code, then whenever I do an update, I will need to continue replacing this line until it is fixed in the code base.
But I'm trying to figure out if there is a way for the element to know that it has just become visible, since at any time you need to know the actual width of the element, then you cannot adjust it until it is displayed. I can’t think of a way to find out, so what I usually do is fix items on a tab the first time I select a tab, but for a shared library, which is not a possible solution.
Location of the main question
, , , , , , , . < - ,
:
<cc1:AsyncFileUpload ID="AsyncFileUpload1" runat="server"
OnClientUploadError="uploadError" OnClientUploadStarted="StartUpload"
OnClientUploadComplete="UploadComplete"
CompleteBackColor="Lime" UploaderStyle="Modern" Width="400px"
ErrorBackColor="Red" ThrobberID="Throbber"
onuploadedcomplete="AsyncFileUpload1_UploadedComplete"
UploadingBackColor="#66CCFF" />
, , ToolkitScriptManager, , , :
<ajax:AjaxScriptManager ID="scriptmanager1" runat="server" EnablePartialRendering="true" ></ajax:AjaxScriptManager>
, LoadScriptsBeforeUI , , , , .
, , dom .