Hi mvjr,
Please try the example below.
- <%@ Page Language="C#" %>
-
- <%@ Register Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" TagPrefix="CuteWebUI" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
- <script runat="server">
- protected void Uploader1_FileUploaded(object sender, UploaderEventArgs args)
- {
- if (args.FileName == "abc.jpg")
- {
- lb_error.Text = "upload error!";
- args.Delete();
- }
- }
- </script>
-
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head id="Head1" runat="server">
- <title>example</title>
- </head>
- <body>
- <form id="form1" runat="server">
- <CuteWebUI:Uploader runat="server" ID="Uploader1" OnFileUploaded="Uploader1_FileUploaded">
- </CuteWebUI:Uploader>
- <asp:Label ID="lb_error" runat="server"></asp:Label>
- </form>
- </body>
- </html>
Regards,
Ken