|
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
|
|
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!
|
|
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
|
|
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!
|
|
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
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Great. Glad that you got it working!
|
|