CuteWebUI_AjaxUploader_OnError Doesn't Fire

  •  02-22-2011, 2:31 PM

    CuteWebUI_AjaxUploader_OnError Doesn't Fire

    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:
     
    1. <ce:uploadattachments id="SkinResourceUploader" runat="server" showprogressbar="true" multiplefilesupload="true" inserttext="select files" uploadtype="Flash">   
    2.     <validateoption allowedfileextensions="jpeg,jpg,js,gif,png,css" />   
    3. </ce:uploadattachments>   
    4. <asp:requiredfieldvalidator id="RequiredValidator" controltovalidate="ErrorTextBox" runat="server" errormessage="file name error 1" />   
    5. <asp:textbox id="ErrorTextBox" runat="server" visible="true" />  
    6. <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:
     
    1. protected void SkinResourceUploader_FileValidating(object sender, CuteEditor.UploaderEventArgs args)   
    2.         {   
    3.             if (System.IO.File.Exists(ResourceFilePath + "Skin\\" + Skin.Id + "\\" + args.FileName))   
    4.             {   
    5.                 ErrorTextBox.Text = "file name error";   
    6.                 throw new Exception("test");   
    7.             }   
    8.         }  
View Complete Thread