net5:动态修改内存中的站点地图节点
2021-06-29 09:04
标签:public 文章 bpa 站点 obj net tar oid tno 原文发布时间为:2008-07-29 —— 来源于本人的百度文章 [由搬家工具导入] using System; public partial class sitemap : System.Web.UI.Page if (id > 0) private int nid() } net5:动态修改内存中的站点地图节点 标签:public 文章 bpa 站点 obj net tar oid tno 原文地址:http://www.cnblogs.com/handboy/p/7141560.html
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
{
protected void Page_Load(object sender, EventArgs e)
{
SiteMap.SiteMapResolve+=new SiteMapResolveEventHandler(SiteMap_SiteMapResolve);
}
SiteMapNode SiteMap_SiteMapResolve(object sender,SiteMapResolveEventArgs e)
{
SiteMapNode currentNode = SiteMap.CurrentNode.Clone(true);
SiteMapNode tempNode=currentNode;
int id=nid();
int page=npage();
{
tempNode.Url = tempNode.Url + "?id=" + id.ToString();
}
if (id > 0 && page >= 0)
{
tempNode.Url = tempNode.Url + "&page=" + page.ToString();
}
else if (page >= 0)
{
tempNode.Url = tempNode.Url + "?page=" + page.ToString();
}
return tempNode;
}
{
return 2;
}
private int npage()
{
return 3;
}