Dynamically generated Tabstrip and MultiPageView

1 posts, 0 answers
  1. Viswanathan
    Viswanathan avatar
    3 posts
    Member since:
    Dec 2012

    Posted 29 Dec 2012 Link to this post


    I have a tabstrip that has a few static tabs and upon a click of a button, a new tab and a new page user controls (from an ascx file) is attached to the tabstrip and multipageview - through the serverside as per the code below: 

    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Dim mTab As New RadTab()
            mTab.Text = "New Release"
            mTab.SelectedCssClass = "Selected"
            mTab.CssClass = "TopTab"
            Dim mPage As New RadPageView
            ' MsgBox("000" & CStr(Val(Trim(Mid(mMultipage.PageViews(mMultipage.PageViews.Count - 1).ID, 1, 2))) + 1))
            mPage.ID = Trim(Right("000" & CStr(Val(Trim(Mid(mMultipage.PageViews(mMultipage.PageViews.Count - 1).ID, 1, 2))) + 1), 2)) + "_mPage_ReleaseForm"
            Me.tabItemTabs.Tabs(tabItemTabs.Tabs.Count - 1).Selected = True
            mMultipage.PageViews(mMultipage.PageViews.Count - 1).Selected = True
        End Sub
        Private Sub mMultipage_PageViewCreated(sender As Object, e As Telerik.Web.UI.RadMultiPageEventArgs) Handles mMultipage.PageViewCreated
            Select Case Trim(Mid(e.PageView.ID, 10))
                Case "ReleaseForm"
                    Dim userControl As Control = Page.LoadControl("releaseform.ascx")
                    userControl.ID = e.PageView.ID & "_userControl"
            End Select
        End Sub

    The issue is first dynamic tab/page is NOT persistent! meaning, when I click on the static tab and click on the dynamically generated tab, the page is no longer visible; however this is NOT the case with subsequent tabs. What am I missing here? 

    Thank you in advance for your advise. 
Back to Top