SiteMapPath控件

关键属性

CurrentNodeStyle             当前节点的样式
CurrentNodeTemplate     当前节点的HTML模板
NodeStyle                          非当前节点的样式
NodeStyleTemplate        非当前节点的HTML模板
PathSeparator                  分隔符所使用的文字 (默认 = ">")
PathSeparatorStyle           分隔符的样式
PathSeparatorTemplate 分隔符所使用的HTML模板
RootNode                         属性用来鉴别根节点
CurrentNode                    属性用来鉴别当前节点
使用 Site Map API

// Write the title of the current node to a Label control
Label1.Text = SiteMap.CurrentNode.Title;

// Write the path to the current node to a Label control
SiteMapNode node = SiteMap.CurrentNode;
StringBuilder builder = new StringBuilder (node.Title);

while (node.ParentNode != null) {
    node = node.ParentNode;
    builder.Insert (0, " > ");
    builder.Insert (0, node.Title);
}

Label1.Text = builder.ToString ();

转载于:https://www.cnblogs.com/AquariusXinXin/archive/2009/12/28/1633912.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值