|
Rank: Member Groups: Member
Joined: 4/22/2010 Posts: 13
|
Hi, I've seen a lot of posts in here about the client-side javascript events not firing, and any posts that have been resolved done seem to help me. I've got a really simple uploader:
Code: HTML/ASPX
<eo:AJAXUploader id="AJAXUploader" runat="server" Width="439px" TempFileLocation="~/lib/uploadTmp" MaxDataSize="30000" Height="168px" Rows="1" OnFileUploaded="AJAXUploader_FileUploaded" ClientSideOnStart="on_uploader_start" ClientSideOnDone="on_uploader_done" ClientSideOnError="error" ClientSideOnProgress="on_uploader_start">
<LayoutTemplate>
<table width="100%" cellpadding="0" cellspacing="0" id="tblUpload">
<tr>
<td style="width: 250px;">
<asp:PlaceHolder ID="InputPlaceHolder" runat="server">Input Box Place Holder
</asp:PlaceHolder>
</td>
<td style="padding-left: 10px;">
<asp:Button ID="UploadButton" runat="server" Text="Upload" />
</td>
</tr>
<tr id="trProgressBar">
<td style="padding-top: 5px;">
<eo:ProgressBar ID="ProgressBar" runat="server" ControlSkinID="None" Height="26px" Width="250px" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" IndicatorColor="#00a3e5"/>
<asp:PlaceHolder ID="ProgressTextPlaceHolder" runat="server">Progress Text Place Holder</asp:PlaceHolder>
</td>
<td style="padding-top: 5px; padding-left: 10px;">
<asp:Button ID="CancelButton" runat="server" Text="Cancel" />
</td>
</tr>
</table>
</LayoutTemplate>
</eo:AJAXUploader>
And then a few simple javascript functions:
Code: JavaScript
function error(uploader, error, message) {
window.alert("This is a custom error message for error '" + error + "'.");
}
function on_uploader_start() {
alert('hello world');
$('#trProgressBar').toggleClass('visible');
}
function on_uploader_done() {
$('#trProgressBar').toggleClass('hidden');
}
Not a single function fires....can anyone help? Thanks higgsy
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Please check whether you have the function placed before the AJAXUploader. I believe the handlers must be placed before the AJAXUploader.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 4/22/2010 Posts: 13
|
Hi,
Yes my javascript is in the head of my page and therefore well above the AJAXUploader.
Any ideas?
Al
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
In that case I can only guess that there is something wrong with your JavaScript block. For example, if your JavaScript block does not have a close tag, then all the functions you have inside that block will be invalid. Try to call those function inside manually (for example, setting them as onclick handler of a div element) to verify whether your functions are valid.
If your functions are valid, please try to isolate the problem into a test page and we will be happy to take a look. Please make sure the test page only contains code needed to reproduce the problem and also runs independently.
Thanks
|
|