Event OnPageViewCreated doesn't fire

2 posts, 1 answers
  1. Christian
    Christian avatar
    97 posts
    Member since:
    Mar 2009

    Posted 08 Apr 2009 Link to this post

    I use TabStrip, In the first Tab should be automaticly load a usercontrol when the page is loadeed, but the Event OnPageViewCreated doesn't fire.

                        <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" OnPageViewCreated="RadMultiPage1_PageViewCreated">  
                            <telerik:RadPageView ID="RadPageView1" runat="server" /> 
                            <telerik:RadPageView ID="RadPageView2" runat="server" /> 
                            <telerik:RadPageView ID="RadPageView3" runat="server" /> 
                            <telerik:RadPageView ID="RadPageView4" runat="server" /> 
                        </telerik:RadMultiPage> 

    The code behind is:

        Public Sub RadMultiPage1_PageViewCreated(ByVal sender As ObjectByVal e As Telerik.Web.UI.RadMultiPageEventArgs)  
            Dim userControlName As String = "import.ascx" 
            Dim userControl As Control = Page.LoadControl(userControlName)  
            userControl.ID = e.PageView.ID + "_userControl" 
            e.PageView.Controls.Add(userControl)  
        End Sub 

    Thanks

    Christian
  2. Answer
    Paul
    Admin
    Paul avatar
    4281 posts

    Posted 08 Apr 2009 Link to this post

    Hello Christian,

    Here's your modified code snippet that works as expected.

    ASPX:
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">  
        <telerik:RadPageView ID="RadPageView1" runat="server" /> 
        <telerik:RadPageView ID="RadPageView2" runat="server" /> 
        <telerik:RadPageView ID="RadPageView3" runat="server" /> 
        <telerik:RadPageView ID="RadPageView4" runat="server" /> 
    </telerik:RadMultiPage> 

    VB.NET
    Public Sub RadMultiPage1_PageViewCreated(ByVal sender As ObjectByVal e As Telerik.Web.UI.RadMultiPageEventArgs) Handles RadMultiPage1.PageViewCreated  
        Dim userControlName As String = "import.ascx" 
        Dim userControl As Control = Page.LoadControl(userControlName)  
        userControl.ID = e.PageView.ID + "_userControl" 
        e.PageView.Controls.Add(userControl)  
    End Sub 
     


    Kind regards,
    Paul
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Back to Top