Întrebare How to override SPSiteMapProvider properties via C#?

  • 23 มิถุนายน 2555 16:35
     
     

    Anyone,
       I wrote a custom SPSiteMapProvider that display menu using a list.


    I also wanted to override most of the values below without changing the master pages so I can have different settings for different sites even though they use the same master pages.
    How do I do it? My code goes like this at the moment. 

    **********  Code ***********

      public class DynaMenuCustomSiteMapProvider: PortalSiteMapProvider
        {
      public override SiteMapNodeCollection GetChildNodes(SiteMapNode node)
            {
                PortalSiteMapNode pNode = node as PortalSiteMapNode;
                if (pNode != null)
                {                
                    if (pNode.Type == NodeTypes.Area && pNode.WebId ==  SPContext.Current.Site.RootWeb.ID)

    *******************************

    These properties that I want to override:

    <SharePoint:AspMenu
    ID="SPSiteMapProvider"
    Runat="server"
    EnableViewState="false"
    DataSourceID="SiteMapDataSource1"
    UseSimpleRendering="true"
    UseSeparateCss="false"
    Orientation="Horizontal"
    StaticDisplayLevels="2"
    MaximumDynamicDisplayLevels="4"

    Please Anyone


    M Sariman RKO Business Solutions Inc.