Re: CuteWebUI_AjaxUploader_OnError Doesn't Fire

  •  02-25-2011, 10:02 AM

    Re: CuteWebUI_AjaxUploader_OnError Doesn't Fire

    Dear mferrell3,
     
    I tested it again on my end, it works fine.
    Please follow the following steps and test it again, if it doesn't work, please let me know.
    1. Download ajax uploader, download link is http://cutesoft.net/downloads/folders/upload/entry44395.aspx
    2. Unzip this installation package
    3. Open IIS
    4. Switch to "Default Web Site" in left tree, right click it, add one virtual directory or application and let it point to "Ajax-Uploader\Framework 2.0-Csharp",you can also point to other same level folder,  name virtual directory or application as "test"
    5. You can visit examples by http://localhost/test//Demo.htm
    6. Save the following snippet to default.aspx:

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <script type="text/javascript">

    function CuteWebUI_AjaxUploader_OnError(msg) {
    alert("CuteWebUI_AjaxUploader_OnError is fired");
    return false;
    }
    </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
          <CuteWebUI:UploadAttachments ShowFrameBrowseButton="false" InsertText="Upload Multiple files Now" runat="server"
                    ID="Attachments1" onfilevalidating="Attachments1_FileValidating" MultipleFilesUpload="true" >
                  
                </CuteWebUI:UploadAttachments>
        </div>
        </form>
    </body>
    </html>

    7. Save the following to default.aspx.cs:
     

    using System;
    using System.Collections.Generic;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }
        protected void Attachments1_FileValidating(object sender, CuteWebUI.UploaderEventArgs args)
        {                 
                throw new Exception("test");       
        }
    }

    8.  After done, please run http://localhost/test/default.aspx:
     
    Thank you for asking
View Complete Thread