How can I write my own tab name in this example?

1 posts, 0 answers
  1. Aamir
    Aamir avatar
    18 posts
    Member since:
    Nov 2010

    Posted 22 Oct 2012 Link to this post

    This examples takes the name of the tab from the name of the .ascx file. I want to have my own tab name,which may include spaces as well.
    Imports System
    Imports Telerik.Web.UI
     
     
    Namespace Telerik.Web.Examples.TabStrip.ApplicationScenarios.LoadOnDemand
     
        Partial Public Class DefaultVB
            Inherits System.Web.UI.Page
            Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
                If Not Page.IsPostBack Then
                    AddTab("Customers")
                    AddPageView(RadTabStrip1.FindTabByText("Customers"))
                    AddTab("Products")
                    AddTab("Orders")
                End If
            End Sub
     
            Private Sub AddTab(ByVal tabName As String)
                Dim tab As RadTab = New RadTab
                tab.Text = tabName
                RadTabStrip1.Tabs.Add(tab)
            End Sub
     
            Protected Sub RadMultiPage1_PageViewCreated(ByVal sender As Object, ByVal e As RadMultiPageEventArgs) Handles RadMultiPage1.PageViewCreated
                Dim userControlName As String = e.PageView.ID & "VB.ascx"
                Dim userControl As Control = Page.LoadControl(userControlName)
                userControl.ID = e.PageView.ID & "_userControl"
                e.PageView.Controls.Add(userControl)
            End Sub
     
            Private Sub AddPageView(ByVal tab As RadTab)
                Dim pageView As RadPageView = New RadPageView
                pageView.ID = tab.Text
                RadMultiPage1.PageViews.Add(pageView)
                pageView.CssClass = "pageView"
                tab.PageViewID = pageView.ID
            End Sub
     
            Protected Sub RadTabStrip1_TabClick(ByVal sender As Object, ByVal e As RadTabStripEventArgs) Handles RadTabStrip1.TabClick
                AddPageView(e.Tab)
                e.Tab.PageView.Selected = True
            End Sub
     
        End Class
     
    End Namespace
Back to Top