CuteWebUI_AjaxUploader_OnStart - not invoked in user control (.ascx page)

Last post 02-28-2013, 1:26 PM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  02-28-2013, 9:45 AM 76947

    CuteWebUI_AjaxUploader_OnStart - not invoked in user control (.ascx page)

    Hi,

     

    I am using 3 uploader control, 2 is in default.aspx and 1 is in usercontrol.ascx and this usercontrol will load on default.aspx on runtime.

     

    I need to clear status label whenver the user click upload button, so i used _OnStart method. But the problem i faced is, i cannot using both places (default.aspx & usercontrol.ascx). If i used in usercontrol page, then default page onstart method is not involked.

     

    function

    In UserControl.ascx

    CuteWebUI_AjaxUploader_OnStart() { 

    document.getElementById("

    <%= UploaderStatus3.ClientID %>').className = 'hidden';

    }

     

    In Default.aspx

    CuteWebUI_AjaxUploader_OnStart() {

    var uploader1 = document.getElementById("<%= Uploader1.ClientID %>");

    var uploader2 = document.getElementById("<%= Uploader2.ClientID %>");

    var hidden = this;

     

    if (hidden.id == "MainContent_Uploader1") {

    document.getElementById(

    '<%= UploaderStatus1.ClientID %>').className = 'hidden';

    }

    else if (hidden.id == "MainContent_Uploader2") {

    document.getElementById(

    '<%= UploaderStatus2.ClientID %>').className = 'hidden';

    }

    else if(hidden.id == "MainContent_SettingsControl_Uploader3")

    //I need to clear a label text in usercontrol How do i achive this???????

     

    }

    }

     

    =========In default.aspx

    <tr>

    <td class="style2" colspan="3">

    <asp:UpdatePanel ID="SettingsControlUpdatePanel" runat="server">

    <ContentTemplate>

    <asp:PlaceHolder ID="SettingsPlaceholder" runat="server" /> <== here i am loading usercontrol1.ascx on runtime

    </ContentTemplate>

    </asp:UpdatePanel>

    </td>

    </tr>

     

     

    Thanks in advance for your valuable reply.

     

    Regards

  •  02-28-2013, 1:26 PM 76950 in reply to 76947

    Re: CuteWebUI_AjaxUploader_OnStart - not invoked in user control (.ascx page)

    Hi sansindia85,

     

    Try

     

    1. <script>  
    2.     function CuteWebUI_AjaxUploader_OnStart() {  
    3.         var mylabel=document.getElementById("<%= myUploader1.FindControl("myLable").ClientID %>");  
    4.     }  
    5. </script>  
     

    myUploader1 is the user control ID which in page default.aspx. myLable is the lable id which in the user control.

     

    user control use in default.aspx.

     

    <%@ Register Src="~/myUploader.ascx" TagPrefix="CE" TagName="myUploader" %>

      <CE:myUploader ID="myUploader1" runat="server" />

     

    User control code

     

    1. <%@ Control Language="C#" ClassName="myUploader" %>  
    2. <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %>  
    3. <script runat="server">  
    4.   
    5. </script>  
    6. <asp:Label ID="myLable" runat="server" Text="some text"></asp:Label>  
    7. <CuteWebUI:UploadAttachments ID="uploader3" runat="server">  
    8. </CuteWebUI:UploadAttachments>  
     

    Regards,

     

    Ken 

View as RSS news feed in XML