User Control For Navigation
Hi all,
How can i create a custom user control for my navigation menu in sitefinity5.0.Can any one give me a sample code or instruction for the same.
Regards,
Vaiga
Hello Vaiga,
Since our default navigation controls are based on the RadControls, you can use these controls to create a custom navigation - for example RadMenu, RadTabStrip, RadTreeView, RadPanelBar etc. Simply add the chosen control to an .ascx file and use SitefinitySiteMapDataSource to bind it to pages in Sitefinity. Here's an example control that uses RadPanelBar:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PanelBar.ascx.cs" Inherits="SitefinityWebApp.Controls.PanelBar" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<
asp:SiteMapDataSource
ID
=
"SiteMapDataSource1"
runat
=
"server"
ShowStartingNode
=
"false"
/>
<
telerik:RadPanelBar
ID
=
"RadPanelBar1"
runat
=
"server"
DataSourceID
=
"SiteMapDataSource1"
>
</
telerik:RadPanelBar
>