TabStrip - Persisting TabStrip Settings

  • Politics
  • Sports
  • Events
Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

In this example you can see how to preserve the Selected Tab of the TabStrip control using the Telerik ASP.NET Persistence Framework.

  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • styles.css
<%@ Page Title="" Language="C#"  AutoEventWireup="true" CodeFile="DefaultCS.aspx.cs" Inherits="DefaultCS" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <telerik:RadPersistenceManager runat="server" ID="RadPersistenceManager1">
        <PersistenceSettings>
            <telerik:PersistenceSetting ControlID="RadTabStrip1" />
        </PersistenceSettings>
    </telerik:RadPersistenceManager>
    <div class="demo-container size-narrow">
        <asp:Label ID="Label1" runat="server"></asp:Label>
        <telerik:RadButton RenderMode="Lightweight" ID="SaveButton" runat="server" Text="Save state" OnClick="SaveButton_Click"  />
        <telerik:RadButton RenderMode="Lightweight" ID="ResetButton" runat="server" Text="Reset state" OnClick="ResetButton_Click"  />
        <telerik:RadButton RenderMode="Lightweight" ID="LoadButton" runat="server" Text="Load state" OnClick="LoadButton_Click"  />
        <telerik:RadTabStrip RenderMode="Lightweight" ID="RadTabStrip1" runat="server" >
            <Tabs>
                <telerik:RadTab Text="Politics">
                    <Tabs>
                        <telerik:RadTab Text="CNN"></telerik:RadTab>
                        <telerik:RadTab Text="NBC"></telerik:RadTab>
                        <telerik:RadTab Text="ABC"></telerik:RadTab>
                    </Tabs>
                </telerik:RadTab>
                <telerik:RadTab Text="Sports">
                    <Tabs>
                        <telerik:RadTab Text="US Sports"></telerik:RadTab>
                        <telerik:RadTab Text="European Sports"></telerik:RadTab>
                    </Tabs>
                </telerik:RadTab>
                <telerik:RadTab Text="Events">
                    <Tabs>
                        <telerik:RadTab Text="Oscar Awards"></telerik:RadTab>
                        <telerik:RadTab Text="MTV Awards"></telerik:RadTab>
                    </Tabs>
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
    </div>
    </form>
</body>
</html>

Find Assistance

Help Us Improve

Was this example helpful?