This is a migrated thread and some comments may be shown as answers.

"Load On Demand" not working in Q1 2010

1 Answer 40 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Jones
Top achievements
Rank 1
Jones asked on 30 Apr 2010, 02:05 PM
I've implemented the Load On Demand for the RadTabStrip & RadMultiPage and followed the sample show in http://demos.telerik.com/aspnet-ajax/tabstrip/examples/applicationscenarios/loadondemand/defaultcs.aspx . My Second and Third tabs load user controls in them.

This working fine with the Q3 2009 Trial Version, but when I purchased the Q1 2010 Developer Version, this stopped working and I receive and error "Two components with the same id 'mpageMain' can't be added to the application".

Here is my ASPX
<%@ Page   
    Language="C#"   
    AutoEventWireup="true"   
    CodeBehind="OnDemandLoad.aspx.cs"   
    Inherits="Telerik.OnDemandLoad" %> 
 
<!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> 
    <title>On Demand Load</title> 
</head> 
<body> 
    <form id="frmOnDemandLoad" runat="server">  
    <asp:ScriptManager ID="smgrMain" runat="server" /> 
      
    <telerik:RadTabStrip  
        ID="tsMain" 
        runat="server" 
        Align="Left" 
        SelectedIndex="0" 
        MultiPageID="mpageMain" 
        OnClientTabSelecting="tsMain_ClientTabSelecting" 
        OnTabClick="tsMain_TabClick" > 
        <Tabs> 
            <telerik:RadTab Text="Alpha" PageViewID="pvAlpha" /> 
            <telerik:RadTab Text="Beta" PageViewID="Beta"/>  
            <telerik:RadTab Text="Gama" PageViewID="Gama"/>  
        </Tabs> 
    </telerik:RadTabStrip> 
      
    <telerik:RadMultiPage   
        ID="mpageMain"   
        runat="server"   
        SelectedIndex="0" 
        OnPageViewCreated="mpageMain_PageViewCreated" 
        ScrollBars="None" 
        BorderWidth="1px">  
        <telerik:RadPageView ID="pvAlpha" runat="server">Alpha</telerik:RadPageView> 
    </telerik:RadMultiPage> 
      
    <telerik:RadAjaxManager ID="amgrMain" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="tsMain">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="tsMain" /> 
                    <telerik:AjaxUpdatedControl ControlID="mpageMain" LoadingPanelID="alpDefault" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="mpageMain">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="mpageMain" LoadingPanelID="alpDefault" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings>   
    </telerik:RadAjaxManager> 
      
    <telerik:RadAjaxLoadingPanel ID="alpDefault" runat="server" /> 
    <telerik:RadScriptBlock ID="rcbMain" runat="server">  
      
        <script language="javascript" type="text/javascript">  
            function tsMain_ClientTabSelecting(sender, args)    
            {    
                if (args.get_tab().get_pageView())    
                {    
                    if(args.get_tab().get_pageView().get_id())    
                    {    
                        args.get_tab().set_postBack(false);    
                    }    
                }    
            }    
        </script> 
    </telerik:RadScriptBlock> 
    </form> 
</body> 
</html> 
 

And my code behind
        private void AddPageView(string pageViewID)  
        {  
            RadPageView pageView = new RadPageView();  
            pageView.ID = pageViewID;  
            mpageMain.PageViews.Add(pageView);  
        }  
 
        protected void tsMain_TabClick(object sender, RadTabStripEventArgs e)  
        {  
            AddPageView(e.Tab.Text);  
            if (e.Tab.PageView == null)  
            {  
                e.Tab.PageViewID = e.Tab.Text;  
            }  
            e.Tab.PageView.Height = Unit.Pixel(e.Tab.Index * 100); 
            e.Tab.PageView.Selected = true;  
        }  
 
        protected void mpageMain_PageViewCreated(object sender, RadMultiPageEventArgs e)  
        {  
            // Load the User Control  
 
            //string strUserControl = "~/UserControls/" + e.PageView.ID + ".ascx";  
            //Control objControl = Page.LoadControl(strUserControl);  
            //objControl.ID = e.PageView.ID + "_userControl";  
            //e.PageView.Controls.Add(objControl);  
        } 

I can no longer use Q3 2009 as it has the Grid's OnCommand Client Event problem.

Is there anything different to be done for the Q1 2010 version?

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 03 May 2010, 09:17 AM
Hi Jones,

Please check this forum post for more details about this issue.

All the best,
Yana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
TabStrip
Asked by
Jones
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or