During upload is in progress i need to change text of InserButton to "Uploading...."

Last post 03-14-2013, 12:07 PM by Kenneth. 5 replies.
Sort Posts: Previous Next
  •  03-09-2013, 11:31 AM 77009

    During upload is in progress i need to change text of InserButton to "Uploading...."

    Step1 :- user selects file 

    Step2:- Text of Insert Button should get changed to "Uploading......"

    Step:- after upload completed Insert Button  Text should get changed to " Upload Completed"

    I was wondering if it is possible in ajaxuploder

    please guide me if any body have idea

     

    Thanks

    Rajiv 

  •  03-11-2013, 12:20 PM 77017 in reply to 77009

    Re: During upload is in progress i need to change text of InserButton to "Uploading...."

    Hi krajiv23,

     

    Please try the example page below, it shows you how to achieve this requirement. I use a button as the uploader button by property "InsertButtonID". And changed the text of this button when uploading and upload complete.

     

    1. <%@ Page Language="C#" %>  
    2.   
    3. <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %>  
    4. <!DOCTYPE html>  
    5.   
    6. <script runat="server">  
    7.     protected void uploader1_UploadCompleted(object sender, UploaderEventArgs[] args)  
    8.     {  
    9.         //change the upload button text after uploaded  
    10.         btnUpload.Text = "Upload Completed";  
    11.     }  
    12. </script>  
    13.   
    14. <html xmlns="http://www.w3.org/1999/xhtml">  
    15. <head runat="server">  
    16.     <title>Untitled Page</title>  
    17. </head>  
    18. <body>  
    19.     <form id="form1" runat="server">  
    20.         <div>  
    21.             <CuteWebUI:Uploader runat="server" ID="uploader1" InsertButtonID="btnUpload" OnUploadCompleted="uploader1_UploadCompleted">  
    22.             </CuteWebUI:Uploader>  
    23.             <asp:Button ID="btnUpload" runat="server" Text="select file" />  
    24.         </div>  
    25.     </form>  
    26. </body>  
    27. </html>  
    28. <script type="text/javascript">  
    29.     function CuteWebUI_AjaxUploader_OnStart() {  
    30.         var btnUpload = document.getElementById("<%= btnUpload.ClientID%>");  
    31.         //change the upload button text when uploading  
    32.         btnUpload.value = "Uploading......";  
    33.     }  
    34. </script>  
     

    Regards,

     

    Ken 

     

     

     

  •  03-11-2013, 2:17 PM 77018 in reply to 77017

    Re: During upload is in progress i need to change text of InserButton to "Uploading...."

    Hi Ken,

    Actually on the  page there could be more than 1 Ajaxuploader at a time , no of Ajaxuploader are decide at runtime,

    so

     

    var btnUpload = document.getElementById("<%= btnUpload.ClientID%>"); 
    it will not get the actual btnupload   client id

     

    example belows shows:-

     

    I am not sure above image is visible to you or not , if it is not ican email. 

     Thanks

    Rajiv 

  •  03-12-2013, 12:15 PM 77029 in reply to 77018

    Re: During upload is in progress i need to change text of InserButton to "Uploading...."

    Hi,

     

    You can check the uploader control id first, so you will know to change which button text.

     

    1. <script type="text/javascript">  
    2. function CuteWebUI_AjaxUploader_OnStart()  
    3. {  
    4.     var hidden=this;  
    5.     if(hidden.id=="uploader1")  
    6.     {  
    7.         //change the Related button text 
    8.     }  
    9. }  
    10. </script>  
     

    Regards,

     

    Ken 

  •  03-13-2013, 12:26 PM 77037 in reply to 77029

    Re: During upload is in progress i need to change text of InserButton to "Uploading...."

    Hi Ken,

     

    is there similar javascript function for stop also like

    ..........................CuteWebUI_AjaxUploader_OnStart()  

    something like..

     

    function CuteWebUI_AjaxUploader_OnStop() {

    var hidden = this;

    }

     

    Thanks

    Rajiv

    Filed under:
  •  03-14-2013, 12:07 PM 77042 in reply to 77037

    Re: During upload is in progress i need to change text of InserButton to "Uploading...."

    Hi,

     

    Yes, the API is

     

    //Fires when upload is stopped and not do postback
    function CuteWebUI_AjaxUploader_OnStop()
    {
        var hidden=this;
        hidden.internalobject.insertBtn.style.display=''
    }

    And you can refer to all API at http://www.ajaxuploader.com/document/scr/html/JavaScript-API.htm

     

    Regards,

     

    Ken 

View as RSS news feed in XML