I have a web control (.ascx) that I'm using the uploader on. Whenever I throw an exception from my C#,
CuteWebUI_AjaxUploader_OnError isn't firing, nor do any of the supposed Javascript events.
I don't like the pop-up error message that is the default of the AjaxUploader. We use ValidationSummary instead, so I'd like to find a way to populate that instead but so far none of the solutions in the forums have worked.
My HTML code:
- <ce:uploadattachments id="SkinResourceUploader" runat="server" showprogressbar="true" multiplefilesupload="true" inserttext="select files" uploadtype="Flash">
- <validateoption allowedfileextensions="jpeg,jpg,js,gif,png,css" />
- </ce:uploadattachments>
- <asp:requiredfieldvalidator id="RequiredValidator" controltovalidate="ErrorTextBox" runat="server" errormessage="file name error 1" />
- <asp:textbox id="ErrorTextBox" runat="server" visible="true" />
-
<
ce:uploadattachments id="SkinResourceUploader" runat="server" showprogressbar="true" multiplefilesupload="true" inserttext="select files" uploadtype="Flash">
<validateoption allowedfileextensions="jpeg,jpg,js,gif,png,css" />
</
ce:uploadattachments>
<
asp:requiredfieldvalidator id="RequiredValidator" controltovalidate="ErrorTextBox" runat="server" errormessage="file name error 1" />
<
asp:textbox id="ErrorTextBox" runat="server" visible="true" />
<
script type="text/javascript">
function CuteWebUI_AjaxUploader_OnError(msg) {
alert(1);
return false;
}
function CuteWebUI_AjaxUploader_OnTaskError(obj, msg, reason) {
alert(1);
return false;
}
function CuteWebUI_AjaxUploader_OnTaskStart(obj) {
alert(1);
}
</
script>
My C# code does this:
- protected void SkinResourceUploader_FileValidating(object sender, CuteEditor.UploaderEventArgs args)
- {
- if (System.IO.File.Exists(ResourceFilePath + "Skin\\" + Skin.Id + "\\" + args.FileName))
- {
- ErrorTextBox.Text = "file name error";
- throw new Exception("test");
- }
- }