Customize Appearance of Button and Progress Panel

Last post 07-08-2014, 1:56 PM by swabygw. 4 replies.
Sort Posts: Previous Next
  •  07-07-2014, 3:42 PM 80371

    Customize Appearance of Button and Progress Panel

    I'd like to do the two following things:

     

    1) Customize the Button control that is clicked to begin select files and to begin uploading.  I've attempted the following code:

     

        upl_AjaxUploader.TempDirectory = "~/uploads"   'upl_AjaxUploader.InsertText = "Upload File (Max 10M)"
       upl_AjaxUploader.InsertText = "Test1"
       upl_AjaxUploader.ValidateOption.AllowedFileExtensions = "*.mp4,*.jpg,*.gif,*.png,*.bmp,*.zip,*.rar"
       upl_AjaxUploader.ValidateOption.MaxSizeKB = 5000
       upl_AjaxUploader.FileTypeNotSupportMsg = "bad file type"
       upl_AjaxUploader.FileTooLargeMsg = "file too large"
       upl_AjaxUploader.ShowProgressBar = True
       upl_AjaxUploader.ShowProgressInfo = True
       upl_AjaxUploader.InsertButtonID = "btn_Upload"
       tcell_Image1.Controls.Add(upl_AjaxUploader)
       
       Dim btn_Upload As New Button
       'btn_Upload.Enabled = False
       btn_Upload.ID = "btn_Upload"
       btn_Upload.Text = "Test2"
       btn_Upload.Width = 500
       tcell_Image1.Controls.Add(btn_Upload)

     

    However, the result is strange - I see what looks like a default button with the word "Upload" on it, and neither of the buttons mentioned in the code should say only "Upload".  Also, the width is uncontrollable even though it's specified in the custom button.  What am I missing here?

     

    2) The progress panel looks and works great.  But, for small files, it goes away too quickly, such that it can't be read.  Is there a way to get the progress panel to stay visible a longer amount of time?

  •  07-08-2014, 9:14 AM 80372 in reply to 80371

    Re: Customize Appearance of Button and Progress Panel

    Hi,

     

    1. Can you try the example below on your site? Does it work for you? The button added in the page load event programmatically.

     

    1. <%@ Page Language="C#" %>  
    2.   
    3. <%@ Register Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" TagPrefix="CuteWebUI" %>  
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    5.   
    6. <script runat="server">  
    7.     protected override void OnLoad(EventArgs e)  
    8.     {  
    9.         Button myButton = new Button();  
    10.         myButton.ID = "myUpload";  
    11.         myButton.Text = "custom upload button";  
    12.         panel1.Controls.Add(myButton);  
    13.         base.OnLoad(e);  
    14.     }  
    15. </script>  
    16.   
    17. <html xmlns="http://www.w3.org/1999/xhtml">  
    18. <head id="Head1" runat="server">  
    19.     <title>Untitled Page</title>  
    20. </head>  
    21. <body>  
    22.     <form id="form1" runat="server">  
    23.         <CuteWebUI:Uploader ID="Uploader1" runat="server" InsertButtonID="myUpload">  
    24.         </CuteWebUI:Uploader>  
    25.         <asp:Panel ID="panel1" runat="server"></asp:Panel>  
    26.     </form>  
    27. </body>  
    28. </html>  
     

    2.  Please refer to http://www.ajaxuploader.com/document/scr/html/JavaScript-API.htm, the API "CuteWebUI_AjaxUploader_OnProgress" allow you create your own progress bar.

     

    Regards,

     

    Ken 

  •  07-08-2014, 12:31 PM 80373 in reply to 80372

    Re: Customize Appearance of Button and Progress Panel

    Thanks for the advice - the button issue is resolved.  For the second issue, I'd like to avoid coding an entirely new progress panel, so is there a way to just change the timing of when the progress panel disappears, or is creating a whole new panel the only solution to change that one attribute?

  •  07-08-2014, 12:36 PM 80374 in reply to 80373

    Re: Customize Appearance of Button and Progress Panel

     Hi swabygw,

     

    Has no setting to change the timing of it for now. I think the only way to create your custom progress bar/panel.

     

    Regards,

     

    Ken 

  •  07-08-2014, 1:56 PM 80375 in reply to 80374

    Re: Customize Appearance of Button and Progress Panel

    Okay - thanks for you help.  It's really a great application.
View as RSS news feed in XML