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

RadPageView and UserControls

16 Answers 577 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Craig Wallace
Top achievements
Rank 1
Craig Wallace asked on 02 Jun 2010, 11:20 AM
Hi.

I have a set of tabs pointing to RadPageViews, with each RadPageView containing a usercontrol.  This doesn't work at all; as soon as the usercontrol is added into the RadPageView content, the tabs no longer work.  How can I load my usercontrols into my RadPageViews?  Can this not be done declaratively?

Craig

16 Answers, 1 is accepted

Sort by
0
Craig Wallace
Top achievements
Rank 1
answered on 02 Jun 2010, 01:43 PM
Well, I am now building it all dynamically and it still does not work.  Clicking on the tabs does nothing, though viewing source on the page I can see that all my user control content is there.

Is this some problem with using the tab control within a user control, or with master pages?

Thanks.
0
Craig Wallace
Top achievements
Rank 1
answered on 02 Jun 2010, 02:19 PM
I have now tried it on a new page with no master page and direct on the aspx, and it still does not work.  All tabs are presented, but clicking them does nothing.  Code below:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Web.Script.WebForm1" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!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">  
    <div> 
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">  
</telerik:RadScriptManager> 
<telerik:RadTabStrip ID="mainTabs" runat="server"   
    Skin="Office2007" MultiPageID="mainMultiPage">  
 
</telerik:RadTabStrip> 
 
<telerik:RadMultiPage ID="mainMultiPage" runat="server"   
            onpageviewcreated="mainMultiPage_PageViewCreated1">  
 
</telerik:RadMultiPage> 
 
    </div> 
    </form> 
</body> 
</html> 
 
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
 
using Telerik.Web.UI;  
 
namespace Web.Script  
{  
    public partial class WebForm1 : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
            if (!Page.IsPostBack)  
            {  
                BuildTabs();  
            }  
        }  
 
        private void BuildTabs()  
        {  
            AddTab("Intro"true);  
            AddPageView("Intro");  
            AddTab("Customer Details"true);  
            AddPageView("CustomerDetails");  
            AddTab("Payment"true);  
            AddPageView("Payment");  
        }  
 
        private void AddTab(string tabText, bool enabled)  
        {  
            RadTab tab = new RadTab(tabText);  
            tab.Enabled = enabled;  
            mainTabs.Tabs.Add(tab);  
        }  
 
        private void AddPageView(string viewID)  
        {  
            RadPageView view = new RadPageView();  
            view.ID = viewID;  
            mainMultiPage.PageViews.Add(view);  
        }  
 
 
        protected void mainMultiPage_PageViewCreated1(object sender, RadMultiPageEventArgs e)  
        {  
            Control userControl = Page.LoadControl("~/Controls/" + e.PageView.ID + ".ascx");  
            userControl.ID = e.PageView.ID + "Content";  
            e.PageView.Controls.Add(userControl);  
        }  
    }  

I am using .Net 4.0, if that matters.

Craig
0
Craig Wallace
Top achievements
Rank 1
answered on 02 Jun 2010, 09:30 PM
Well it looks like it does matter as the same code works well in VS 2008 with .Net 3.5.
0
Yana
Telerik team
answered on 03 Jun 2010, 03:52 PM
Hi Craig Wallace,

The code seems correct, I guess that there's some javascript error on your page which blocks the scripts of the tabstrip. Could you please check?

Kind regards,
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.
0
Craig Wallace
Top achievements
Rank 1
answered on 03 Jun 2010, 04:21 PM
Hi Yana.

Just checked and there are no javascript errors thrown.  Checked with Firefox too.  I suspect this issue is to do with the fact that I am currently using the Release Candidate of VS 2010 and .Net Framework 4.0.  Can you confirm this?

Thanks.
0
Craig Wallace
Top achievements
Rank 1
answered on 04 Jun 2010, 11:52 AM
Hi Yana.
Does the RadTabStrip control definitely work in .Net Framework 4.0 RTM, with Master Pages and user controls?  I need to know before purchasing.
Thanks.
0
Yana
Telerik team
answered on 04 Jun 2010, 02:56 PM
Hi Craig,

We can confirm that RadControls are compatible with .Net Framework 4.0 (there are native NET 4 builds of Telerik.Web.UI.dll and Telerik.Web.Design.dll), please check this blog post for more information.

If you still experience this problem, could you please send us a simple runnable page which we can test? Thanks

Best wishes,
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.
0
Craig Wallace
Top achievements
Rank 1
answered on 14 Jun 2010, 02:30 PM
Hi Yana,

I have now tried it in the full version of VS 2010 and it did not work.  I have sent in a support ticket with project attached.

Craig
0
Yana
Telerik team
answered on 14 Jun 2010, 02:49 PM
Hi Craig,

Thank you, we'll review the project from the support ticket.

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.
0
Chris Ramey
Top achievements
Rank 1
answered on 16 Sep 2010, 04:10 PM
Has a solution been found? I am having the same problem. The tabs work fine until user controls are added. The tabs click event fires but the the tab will not change to the new tab. I am using Q3 2009 version of Rad tools and VS 2010. The site is being compiled as a 4.0 site.
0
T. Tsonev
Telerik team
answered on 16 Sep 2010, 04:43 PM
Hi Chris,

The problem should be solved now. Can you please check that the PageViewIDs set on the RadTabs match the actual IDs of the PageViews?

I hope this helps.

All the best,
Tsvetomir Tsonev
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
0
Chris Ramey
Top achievements
Rank 1
answered on 16 Sep 2010, 05:33 PM
I have updated to the latest controls and added the PageViewID. I am still having the same issue.

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1"
                         SelectedIndex="0" ontabclick="RadTabStrip1_TabClick" >
    <Tabs>
        <telerik:RadTab runat="server" Text="Contact Information" ImageUrl="~/sections/include/red8.gif" PageViewID="RadPageViewContact" Selected="True">
        </telerik:RadTab>
        <telerik:RadTab runat="server" Text="Section 1" ImageUrl="~/sections/include/red8.gif"  PageViewID="RadPageView1">
        </telerik:RadTab>
        <telerik:RadTab runat="server" Text="Section 2" ImageUrl="~/sections/include/red8.gif" PageViewID="RadPageView2">
        </telerik:RadTab>
    </Tabs>   
    </telerik:RadTabStrip>
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" >
             <telerik:RadPageView runat="server" ID="RadPageViewContact"
                <h1>Page1   </h1>          
             </telerik:RadPageView>
             <telerik:RadPageView runat="server" ID="RadPageView1">                
                 <uc1:Section1 ID="Section1" runat="server" /> 
             </telerik:RadPageView>
             <telerik:RadPageView runat="server" ID="RadPageView2">
                <uc2:Section2 ID="Section2" runat="server" />                  
             </telerik:RadPageView>
    </telerik:RadMultiPage>
</asp:Content>
0
Chris Ramey
Top achievements
Rank 1
answered on 16 Sep 2010, 06:09 PM
I think I have resolved the issue. If there is an error in one of the user controls the error is never displayed and the tabs quit working.
0
John
Top achievements
Rank 1
answered on 06 Mar 2015, 11:55 AM
I am also having the same problem. I reduced the control to having one input field, any more dotnet controls and the tab would not render (VS2013).
0
John
Top achievements
Rank 1
answered on 06 Mar 2015, 12:10 PM
Seems to be when I add a .net required field validator.
0
Marin Bratanov
Telerik team
answered on 06 Mar 2015, 04:48 PM

Hello John,

This seems like an issue caused by the unobtrusive validation in .NET 4.5 and jQuery. I advise that you review this article for details on the matter: http://www.telerik.com/help/aspnet-ajax/introduction-troubleshooting-jquery.html.

Another possibility is that the BrowserLink feature in VS is causing the WebResource requests (that our controls also use) to fail, so you should disable it to see if this is the case.

Regards,

Marin Bratanov
Telerik
 

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.

 
Tags
TabStrip
Asked by
Craig Wallace
Top achievements
Rank 1
Answers by
Craig Wallace
Top achievements
Rank 1
Yana
Telerik team
Chris Ramey
Top achievements
Rank 1
T. Tsonev
Telerik team
John
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or