Welcome Guest Search | Active Topics | Sign In | Register

AJAX Uploader - client side error handler Options
victorg
Posted: Wednesday, July 1, 2009 6:27:25 PM
Rank: Member
Groups: Member

Joined: 7/1/2009
Posts: 11
hallo

i tried to use the error handler for the ajax uploader but it seems it doesn't work. my javascript looks as follows:

function error_handler(uploader, error, message)
{
if (error == "max_size_exceeded")
alert("Max size!");
else if (error == "extension_not_allowed")
alert("Extension");
else
alert("Unknown error.");

}

and i use the uploader in the following way:

<eo:AJAXUploader MaxFileCount="1" OnFileUploaded="photo_uploaded" AutoPostBack="true" AutoUpload="false"
AllowedExtension=".jpg|.gif|.png|.jpeg" MaxDataSize="10240" ClientSideOnError="error_handler"
HideDisabledToolBarButton="true" runat="server" id="eo_upload" TempFileLocation="~/temp/" Width="60%">
<LayoutTemplate>

<asp:PlaceHolder runat="server" id="InputPlaceHolder"></asp:PlaceHolder>
<asp:Button runat="server" ID="UploadButton" CssClass="A_white" Text="upload"></asp:Button>

<asp:PlaceHolder runat="server" Visible="true" id="ProgressTextPlaceHolder"></asp:PlaceHolder>




</LayoutTemplate>
</eo:AJAXUploader>

am i doing something wrong ?

thanks
eo_support
Posted: Wednesday, July 1, 2009 6:34:16 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Your code looks fine to us. Did you try it in a blank test page? We tried to browse a test file with an .exe extension, then click "upload", we got an "Extension" message box, which is displayed by your custom handler.

Thanks!
victorg
Posted: Wednesday, July 1, 2009 6:40:24 PM
Rank: Member
Groups: Member

Joined: 7/1/2009
Posts: 11
made some investigations:
the code works perfect when the control is placed outside of an update panel!
but when i surround it with an update panel it doesnt't work anymore. outside the panel i've added the scriptmanager too: <eo:ScriptManager runat="server"></eo:ScriptManager>

thanks
eo_support
Posted: Wednesday, July 1, 2009 7:25:14 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Can you provide a full test page? We are not aware of any issues with UpdatePanel. Please make sure the test page runs independently so that we can run it here and see the problem. As soon as we can see it here, we should be able to tell you exactly what triggered the issue.

Thanks!
victorg
Posted: Wednesday, July 1, 2009 7:26:44 PM
Rank: Member
Groups: Member

Joined: 7/1/2009
Posts: 11
i've managed to make it work! i moved the javascript code outside the updatepanel and everything works perfect now.

thanks
eo_support
Posted: Wednesday, July 1, 2009 7:41:21 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Great. Glad that you got it working!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.