Multipage on demand with post back not working

2 posts, 0 answers
  1. ajay
    ajay avatar
    2 posts
    Member since:
    Feb 2015

    Posted 10 Feb 2015 Link to this post

    Hi Telerik forum,
    I am trying to implement ondemand property of Radmultipage using the It is working some how. But what i need is i want to postback on each time when tab clicked .
    For this i removed clientFunction called "onClientTabselecting".

    This is where i am facing the problem. I am getting the error "Multiple controls with same ID found...." . And in my two of my viewpages contain user controls
    I am getting the respective error only on re-clicking on the tab which contain user control.

     My design:
    <telerik:RadTabStrip ID="Vehicles" runat="server" Skin="Metro" MultiPageID="RadMultiPage1" 
                           SelectedIndex="0" Width="99%" OnTabClick="Vehicles_TabClick" 
            <telerik:RadTab Text="Cars"  PageViewID="radCars" Value="radTabCars"> </telerik:RadTab>
            <telerik:RadTab Text="Train"   Value="radTabTrain">  </telerik:RadTab>                  
            <telerik:RadTab Text="Bus" CssClass="CustomTab"  HoveredCssClass="HoveredTab"
           <telerik:RadTab Text="Cycle"  Value="radTabCycle" > </telerik:RadTab>
           <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" OnPageViewCreated="RadMultiPage1_PageViewCreated"
           <telerik:RadPageView ID="radPVCars" runat="server">
                <telerik:RadGrid ID="grdCars" runat="server" AllowSorting="true" </telerik:RadGrid>
            <telerik:RadPageView ID="radPVTrain" runat="server">
              <DManagement:Fax runat="server" ID="UCTrain" Status="Train" />
            <telerik:RadPageView ID="radPVBus" runat="server">
                  <DManagement:Fax runat="server" ID="UCcyvle" Status="Bus" />
           <telerik:RadPageView ID="radPVCycle" runat="server">
           <telerik:RadGrid ID="grdCycle" runat="server" AllowSorting="true" </telerik:RadGrid>


     Code behind:

    protected void Vehicles_TabClick(object sender, RadTabStripEventArgs e)
                e.Tab.PageView.Selected = true;
         private void AddPageView(RadTab tab)
                RadPageView pageView = new RadPageView();
                if (tab.Value == "radTabCars")
                    RadMultiPage1.SelectedIndex = RadMultiPage1.FindPageViewByID("radPVCars").Index;
                    tab.PageViewID = "radPVCars";
                else if (tab.Value == "radTabCycle")
                    RadMultiPage1.SelectedIndex = RadMultiPage1.FindPageViewByID("radPVCycle").Index;
                    tab.PageViewID = "radPVCycle";
                switch (tab.Value)
                    case "radTabTrain":
                        pageView.ID = "radPVTrain";
                    case "radTabBus":
                        pageView.ID = "radPVBus";
                RadMultiPage1.SelectedIndex = RadMultiPage1.PageViews.Count - 1;
                tab.PageViewID = pageView.ID;
          protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e)
                string uControlName = "";
                string uControlId = "";
                 switch (e.PageView.ID)
                    case "radPVTrain":
                        uControlName = "~/USC/UserControls/Dgmt_vehicle.ascx";
                        userControlId = "VehTrain";
                    case "radPVBus":
                        uControlName = "~/USC/UserControls/Dgmt_vehicle.ascx";
                        userControlId = "VehBus";
                Control userControl1 = Page.LoadControl(userControlName);
                UserControls.Dgmt_Faxes objControl = (UserControls.Dgmt_Faxes)userControl1;
                 if (uControlId  == "VehTrain")
                    objControl.Status = "Train";
                else if (uControlId  == "VehBus")
                    objControl.Status = "Bus";
                userControl = (VehicleUserControl)userControl1;
                userControl.ID = userControlId;
                e.PageView.EnableViewState = true;
  2. Viktor Tachev
    Viktor Tachev avatar
    1447 posts

    Posted 13 Feb 2015 Link to this post


    The error you describe is usually observed when the ID of two or more controls on the page are duplicated. Please check the ID of the controls in both User Controls and ensure that there are no duplicates.

    Also, you can make the RadMultiPage render only one page at a time. For this you need to set the RenderSelectedPageOnly to true.

    Viktor Tachev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. DevCraft R3 2016 release webinar banner
Back to Top