In Database
tbl_SiteMap (table)
Script
CREATE TABLE [dbo].[tbl_SiteMap](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Title] [varchar](32) COLLATE Chinese_PRC_CI_AS NULL,
[Description] [varchar](512) COLLATE Chinese_PRC_CI_AS NULL,
[Url] [varchar](512) COLLATE Chinese_PRC_CI_AS NULL,
[Roles] [varchar](512) COLLATE Chinese_PRC_CI_AS NULL,
[Parent] [int] NULL,
CONSTRAINT [PK_SiteMap] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
uspSystemGetSiteMap (store procedure)
Script
CREATE PROCEDURE [dbo].[usp_System_GetSiteMap] AS
SELECT [ID], [Title], [Description], [Url], [Roles], [Parent]
FROM [tbl_SiteMap] ORDER BY [ID]

In View
<%=Html.Menu(1, "sf-menu")%>
The first parameter is the start level of the menu item rendered. 1 means the menu will render all the menu items except the root menu item.
The second parameter is the css class name of the menu.

In web.config
<system.web>
<connectionStrings>
<add name="ApplicationServices" connectionString="Data Source=192.168.1.7;Initial Catalog=WMS;Persist Security Info=True;User ID=tonyqus;Password=tonyqus" providerName="System.Data.SqlClient" />
</connectionStrings>
...
<siteMap enabled="true" defaultProvider="AspNetSqlSiteMapProvider">
<providers>
<add name="AspNetSqlSiteMapProvider"
type="SqlSiteMapProvider,Dragon.Prototype1.Infrastructure"
securityTrimmingEnabled="true"
connectionStringName="ApplicationServices"
sqlCacheDependency="WMS:tbl_SiteMap" />
</providers>
</siteMap>
</system.web>

The parameter called sqlCacheDependency is <DatabaseName>:<TableName>

NOTE: To enable Query Notification, you must install SQL Server Notification Service on your database server.

Last edited Nov 8, 2009 at 4:10 AM by tonyqus, version 3

Comments

No comments yet.