asp.net.ph

SiteMapPath.NodeStyle Property

System.Web.UI.WebControls Namespace   SiteMapPath Class


.NET Framework version 2.0

Sets or retrieves the default style properties for the nodes in a SiteMapPath control.

Syntax


Script SiteMapPath.NodeStyle.Property [ = enumValue ]

Property Value

A Style object that defines the default style properties for the nodes in a SiteMapPath.

Remarks

Use the NodeStyle property to specify the default appearance of a node in a SiteMapPath control. Common style attributes that can be set include forecolor, backcolor, font, and content alignment. Providing different node styles enhances the appearance of the SiteMapPath control.

The NodeStyle subproperties can be set declaratively using either of the following methods:

  • Include an attribute in the opening tag of the SiteMapPath control in the form NodeStyle-Property
    <asp:sitemappath ... 
       nodestyle-property=value
       ... >
    
    </asp:sitemappath>
  • Include a <NodeStyle> element between the opening and closing tags of the SiteMapPath control
    <asp:sitemappath ... >
    
       <nodestyle
          ... property definitions here />
    
    </asp:sitemappath>

The subproperties can also be set programmatically in the form NodeStyle.Property.

Style properties are applied in the following order of precedence:

NOTE: The corresponding node style settings in the RootNodeStyle, ParentNodeStyle, or CurrentNodeStyle properties override the style settings of the NodeStyle property.

If you set the node font style to a strikeout or overline style, the default underline style of the node is not displayed unless it is explicitly set to true.

NOTE: If a NodeTemplate property is defined, the NodeStyle property is ignored.

For a list of style properties that can be set, see the Style class.

Example

The below snippet shows how to set the NodeStyle for a SiteMapPath control at design time.

<asp:sitemappath id = "sitemappath1" runat = "server"
   rendercurrentnodeaslink
   nodestyle-font-name = "Franklin Gothic Medium"
   nodestyle-font-underline
   nodestyle-font-bold
   rootnodestyle-font-name = "Symbol"
   rootnodestyle-font-bold = "false"
   currentnodestyle-font-name = "Verdana"
   currentnodestyle-font-size = "10pt"
   currentnodestyle-font-bold
   currentnodestyle-forecolor = "red"
   currentnodestyle-font-underline = "false"
   hovernodestyle-forecolor = "blue"
   hovernodestyle-font-underline />
See Also

SiteMapPath Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph