RadPageView and UserControls

17 posts, 0 answers
  1. Craig Wallace
    Craig Wallace avatar
    118 posts
    Member since:
    Jan 2005

    Posted 02 Jun 2010 Link to this post

    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
  2. Craig Wallace
    Craig Wallace avatar
    118 posts
    Member since:
    Jan 2005

    Posted 02 Jun 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Craig Wallace
    Craig Wallace avatar
    118 posts
    Member since:
    Jan 2005

    Posted 02 Jun 2010 Link to this post

    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
  5. Craig Wallace
    Craig Wallace avatar
    118 posts
    Member since:
    Jan 2005

    Posted 02 Jun 2010 Link to this post

    Well it looks like it does matter as the same code works well in VS 2008 with .Net 3.5.
  6. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 03 Jun 2010 Link to this post

    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.
  7. Craig Wallace
    Craig Wallace avatar
    118 posts
    Member since:
    Jan 2005

    Posted 03 Jun 2010 Link to this post

    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.
  8. Craig Wallace
    Craig Wallace avatar
    118 posts
    Member since:
    Jan 2005

    Posted 04 Jun 2010 Link to this post

    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.
  9. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 04 Jun 2010 Link to this post

    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.
  10. Craig Wallace
    Craig Wallace avatar
    118 posts
    Member since:
    Jan 2005

    Posted 14 Jun 2010 Link to this post

    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
  11. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 14 Jun 2010 Link to this post

    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.
  12. Chris Ramey
    Chris Ramey avatar
    4 posts
    Member since:
    Jul 2009

    Posted 16 Sep 2010 Link to this post

    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.
  13. T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 16 Sep 2010 Link to this post

    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
  14. Chris Ramey
    Chris Ramey avatar
    4 posts
    Member since:
    Jul 2009

    Posted 16 Sep 2010 Link to this post

    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>
  15. Chris Ramey
    Chris Ramey avatar
    4 posts
    Member since:
    Jul 2009

    Posted 16 Sep 2010 Link to this post

    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.
  16. John
    John avatar
    11 posts
    Member since:
    Mar 2015

    Posted 06 Mar 2015 Link to this post

    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).
  17. John
    John avatar
    11 posts
    Member since:
    Mar 2015

    Posted 06 Mar 2015 in reply to John Link to this post

    Seems to be when I add a .net required field validator.
  18. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 06 Mar 2015 Link to this post

    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.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017