RadAjaxManager and UserControls

4 posts, 0 answers
  1. Craig Hinkel
    Craig Hinkel avatar
    36 posts
    Member since:
    May 2008

    Posted 25 Feb 2009 Link to this post

    Hello,

    on one of my pages i have a usercontrol that exposes a OnClick event. When i add an ajaxsetting on the manager for the usercontrol and the associated event, my updated controls are not being updated. do i need to do something different to wire up user controls?

  2. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3375 posts
    Member since:
    Sep 2012

    Posted 25 Feb 2009 Link to this post

    Hello Craig,

    Could you please send us (or paste here) the problematic page and user control?
    I will check it out and try providing a proper solution for you.
     
    Looking forward your reply,
    Iana
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

  3. Craig Hinkel
    Craig Hinkel avatar
    36 posts
    Member since:
    May 2008

    Posted 25 Feb 2009 Link to this post

    Sure, here you go:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %> 
    <%@ Register Assembly="Telerik.Charting, Version=2.0.4.0, Culture=neutral, PublicKeyToken=d14f3dcc8e3e8763" Namespace="Telerik.Charting" TagPrefix="telerik" %> 
    <%@ Register Assembly="Telerik.Web.UI, Version=2008.2.826.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    <%@ Register TagName="Tabs" TagPrefix="tsg" Src="~/DashboardTabs.ascx" %> 
    <!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>  
    </head> 
    <body> 
        <form id="form1" runat="server">  
            <asp:ScriptManager ID="scriptManager1" runat="server"></asp:ScriptManager> 
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdatePanelsRenderMode="Inline">  
                <AjaxSettings> 
                    <telerik:AjaxSetting AjaxControlID="ucTabs" EventName="ucTabs_TabClick">  
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="ucTabs" /> 
                            <telerik:AjaxUpdatedControl ControlID="rmpReports" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting>     
                </AjaxSettings> 
            </telerik:RadAjaxManager> 
     
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server" Width="894">  
                <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border: 0px;" /> 
            </telerik:RadAjaxLoadingPanel> 
              
            <tsg:Tabs id="ucTabs" runat="server" OnTabClick="ucTabs_TabClick" /> 
     
            <div id="dvContainer" runat="server" style="width:100%; border: solid 1px black;">  
                <telerik:RadMultiPage ID="rmpReports" runat="server" Width="100%">  
                    <telerik:RadPageView ID="RadPageView1" runat="server" TabIndex="0">Page 1</telerik:RadPageView> 
                    <telerik:RadPageView ID="RadPageView2" runat="server" TabIndex="1">Page 2</telerik:RadPageView> 
                    <telerik:RadPageView ID="RadPageView3" runat="server" TabIndex="2">Page 3</telerik:RadPageView> 
                    <telerik:RadPageView ID="RadPageView4" runat="server" TabIndex="3">Page 4</telerik:RadPageView> 
                    <telerik:RadPageView ID="RadPageView5" runat="server" TabIndex="4">Page 5</telerik:RadPageView> 
                </telerik:RadMultiPage> 
            </div> 
        </form> 
    </body> 
    </html> 
     
    using System;  
    using System.Collections.Generic;  
    using System.Web;  
    using System.Web.UI;  
    using System.Web.UI.WebControls;  
     
    namespace WebApplication1  
    {  
        public partial class _Default : System.Web.UI.Page  
        {  
            protected void ucTabs_TabClick(object sender, EventArgs e)  
            {  
                this.rmpReports.SelectedIndex = new Random().Next(0, 4);  
            }  
        }  
    }  
     
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DashboardTabs.ascx.cs" Inherits="WebApplication1.DashboardTabs" %> 
    <%@ Register Assembly="Telerik.Charting, Version=2.0.4.0, Culture=neutral, PublicKeyToken=d14f3dcc8e3e8763" Namespace="Telerik.Charting" TagPrefix="telerik" %> 
    <%@ Register Assembly="Telerik.Web.UI, Version=2008.2.826.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
     
    <telerik:RadTabStrip ID="rtsNavigation" runat="server" Skin="Outlook" Width="100%" OnTabClick="rtsNavigation_TabClick">  
        <Tabs> 
            <telerik:RadTab Text="The Big Picture" TabIndex="0" Selected="True" />   
            <telerik:RadTab Text="Key Driver Index" TabIndex="1" /> 
            <telerik:RadTab Text="CSR Trusted Advisor Index" TabIndex="2" /> 
            <telerik:RadTab Text="Platform Trusted Advisor Index" TabIndex="3" /> 
            <telerik:RadTab Text="Other Key Metrics" TabIndex="4" /> 
        </Tabs> 
    </telerik:RadTabStrip> 
    using System;  
    using System.Collections.Generic;  
    using System.Web;  
    using System.Web.UI;  
    using System.Web.UI.WebControls;  
     
    namespace WebApplication1  
    {  
        public delegate void TabClickEventHandler(object sender, EventArgs e);  
     
        public partial class DashboardTabs : System.Web.UI.UserControl   
        {  
            public event TabClickEventHandler TabClick;  
     
            protected void Page_Load(object sender, EventArgs e)  
            {  
                if (!IsPostBack)  
                {  
                    rtsNavigation.SelectedIndex = 0;  
                    OnTabClick();  
                }  
            }  
     
            protected void rtsNavigation_TabClick(object sender, Telerik.Web.UI.RadTabStripEventArgs e)  
            {  
                OnTabClick();  
            }  
     
            protected virtual void OnTabClick()  
            {  
                if (TabClick != null)  
                {  
                    TabClick(this, EventArgs.Empty);  
                }  
            }  
        }  

  4. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3375 posts
    Member since:
    Sep 2012

    Posted 26 Feb 2009 Link to this post

    Hi Craig,

    Please try setting the EventName property to TabClick and see if it makes any difference.

    Additionally, I prepared a sample project based on your code, and the TabClick event is fired as expected on my side. Let me know how does it work with you.

    Sincerely yours,
    Iana
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

Back to Top