PanelBar - Programmatic State Persistence

Current page

This is the home page

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

RadPanelBar is often used as a navigation element. This example shows how to persist the state of the panelbar by using the RadPanelBar's FindItemByUrl method.

Please review the code for more details.

  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • styles.css
<%@ Page Language="c#" CodeFile="DefaultCS.aspx.cs" AutoEventWireup="true" Inherits="PanelBar.Examples.ApplicationScenarios.PersistingState.DefaultCS" %>

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

<!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" />
    <div class="demo-container size-medium">
        <telerik:RadPanelBar RenderMode="Lightweight" runat="server" ID="RadPanelBar1" Width="350px" Height="300" ExpandMode="FullExpandedItem">
            <Items>
                <telerik:RadPanelItem Text="ASP.NET controls" Expanded="True">
                    <Items>
                        <telerik:RadPanelItem NavigateUrl="DefaultCS.aspx?page=menu" Text="RadMenu" />
                        <telerik:RadPanelItem NavigateUrl="DefaultCS.aspx?page=combobox" Text="RadComboBox" />
                        <telerik:RadPanelItem NavigateUrl="DefaultCS.aspx?page=panelbar" Text="RadPanelBar" />
                        <telerik:RadPanelItem NavigateUrl="DefaultCS.aspx?page=treeview" Text="RadTreeView" />
                    </Items>
                </telerik:RadPanelItem>
                <telerik:RadPanelItem Text="WinForms controls">
                    <Items>
                        <telerik:RadPanelItem Text="RadMenustrip" NavigateUrl="DefaultCS.aspx?page=menustrip" />
                        <telerik:RadPanelItem Text="RadTabStrip" NavigateUrl="DefaultCS.aspx?page=tabstrip" />
                        <telerik:RadPanelItem Text="RadToolStrip" NavigateUrl="DefaultCS.aspx?page=toolbarstrip" />
                    </Items>
                </telerik:RadPanelItem>
                <telerik:RadPanelItem Text="Other projects">
                    <Items>
                        <telerik:RadPanelItem Text="SiteFinity" NavigateUrl="DefaultCS.aspx?page=sitefinity" />
                        <telerik:RadPanelItem Text="Reporting" NavigateUrl="DefaultCS.aspx?page=reporting" />
                        <telerik:RadPanelItem Text="RadAjax" NavigateUrl="DefaultCS.aspx?page=ajax" />
                    </Items>
                </telerik:RadPanelItem>
            </Items>
        </telerik:RadPanelBar>
        <div class="qsf-result">
            <h2>Current page</h2>
            <p>
                <asp:Literal runat="server" ID="Literal1" /></p>
        </div>
    </div>
    </form>
</body>
</html>

Find Assistance

Help Us Improve

Was this example helpful?