关于SiteMapPath的求助帖

johnny571 2009-05-24 06:12:51
环境:Visual Studio 2008
语言:C#
程序:ASP.NET

首先,请看我的web.sitemap文件代码:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

<siteMapNode url="~/Default.aspx" title="首页" description="">


<siteMapNode url="~/SiteMasterHomePage.aspx" title="站长主页" description="">
<siteMapNode url="~/SiteMasterHomePage/Setting.aspx" title="设置" description="" />
<siteMapNode url="~/SiteMasterHomePage/Music.aspx" title="音乐" description="" />
<siteMapNode url="~/SiteMasterHomePage/Album.aspx" title="相册" description="" />
<siteMapNode url="~/SiteMasterHomePage/LeaveMessage.aspx" title="留言" description="" />
<siteMapNode url="~/SiteMasterHomePage/Hobby.aspx" title="爱好" description="" />
<siteMapNode url="~/SiteMasterHomePage/UpLoad.aspx" title="上传" description="" />
<siteMapNode url="~/SiteMasterHomePage/Appreciate.aspx" title="欣赏" description="" />
<siteMapNode url="~/SiteMasterHomePage/Chat.aspx" title="聊天" description="" />
<siteMapNode url="~/SiteMasterHomePage/Query.aspx" title="查询" description="" />
</siteMapNode>

<siteMapNode url="~/AddFriends.aspx" title="加为好友" description="">
<siteMapNode url="~/AddFriends.aspx/Setting.aspx" title="设置" description="" />
<siteMapNode url="~/AddFriends.aspx/Music.aspx" title="音乐" description="" />
<siteMapNode url="~/AddFriends.aspx/Album.aspx" title="相册" description="" />
<siteMapNode url="~/AddFriends.aspx/LeaveMessage.aspx" title="留言" description="" />
<siteMapNode url="~/AddFriends.aspx/Hobby.aspx" title="爱好" description="" />
<siteMapNode url="~/AddFriends.aspx/Appreciate.aspx" title="欣赏" description="" />
<siteMapNode url="~/AddFriends.aspx/Query.aspx" title="查询" description="" />
</siteMapNode>

<siteMapNode url="~/FriendsSpace.aspx" title="好友空间" description="">
<siteMapNode url="~/FriendsSpace.aspx/Setting.aspx" title="设置" description="" />
<siteMapNode url="~/FriendsSpace.aspx/Music.aspx" title="音乐" description="" />
<siteMapNode url="~/FriendsSpace.aspx/Album.aspx" title="相册" description="" />
<siteMapNode url="~/FriendsSpace.aspx/LeaveMessage.aspx" title="留言" description="" />
<siteMapNode url="~/FriendsSpace.aspx/Hobby.aspx" title="爱好" description="" />
<siteMapNode url="~/FriendsSpace.aspx/Appreciate.aspx" title="欣赏" description="" />
<siteMapNode url="~/FriendsSpace.aspx/Query.aspx" title="查询" description="" />
<siteMapNode url="~/FriendsSpace.aspx/Chat.aspx" title="聊天" description="" />
</siteMapNode>

</siteMap>

我的文件页结构如下:

首页
站长主页
加为好友
好友空间

但当我运行之后,系统给出如下错误提示:

配置错误
说明: 在处理向该请求提供服务所需的配置文件时出错。请检查下面的特定错误详细信息并适当地修改配置文件。

分析器错误消息: 未能加载 XML 站点地图配置文件 /深蓝火焰个人网站/web.sitemap。行 4 上的开始标记“siteMapNode”与结束标记“siteMap”不匹配。 行 40,位置 3。

源错误:


行 38: </siteMapNode>
行 39:
行 40: </siteMap>



源文件: D:\深蓝火焰个人网站\web.sitemap 行: 40

谁知道我错在什么地方了?代码应该如何修改?
另外,我无论如何修改web.sitemap代码,系统始终都会给出三个错误提示,如下:

错误 6 “ASP.sitemasterhomepage_aspx.GetTypeHashCode()”: 没有找到适合的方法来重写
错误 7 “ASP.sitemasterhomepage_aspx.ProcessRequest(System.Web.HttpContext)”: 没有找到适合的方法来重写
错误 8 “ASP.sitemasterhomepage_aspx”不实现接口成员“System.Web.IHttpHandler.IsReusable

这3个错误我问遍好多人都没解决,已被困了半月之久毫无进展,跪求高手帮我解决,谢谢了!
...全文
124 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
wxm686637 2009-05-24
  • 打赏
  • 举报
回复
siteMapNode 都是成对出现的 自己检查下有没有漏掉的
C_NET_rgz 2009-05-24
  • 打赏
  • 举报
回复
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

<siteMapNode url="~/Default.aspx" title="首页" description="">
这行没有结束标志,写代码细心点!!!
zouzedong 2009-05-24
  • 打赏
  • 举报
回复
<siteMapNode url="~/SiteMasterHomePage.aspx" title="站长主页" description="" />
这样改就是你说的那种结构了·
zouzedong 2009-05-24
  • 打赏
  • 举报
回复
如果 你第一个以/结尾 也不会有错的
zouzedong 2009-05-24
  • 打赏
  • 举报
回复
其它的有/结尾 · · 就是代表结束 `
johnny571 2009-05-24
  • 打赏
  • 举报
回复
一楼的高手请帮我答疑解惑,一般来说,<siteMapNode>和</siteMapNode>是成对出现的,为什么只加一个</siteMapNode>呢?在我的代码中,的确有一个<siteMapNode>未配对</siteMapNode>,代码如下:

<siteMapNode url="~/Default.aspx" title="首页" description="">

在加上</siteMapNode>之后,程序的确可以正常运行,可是那样文件结构不就变成了
首页
--站长主页
--加为好友
--好友空间
其余3个网页变成了"首页"的子页了,而我的初衷是4个网页是平行结构的,谁都不是谁的子页,况且诸如
<siteMapNode url="~/SiteMasterHomePage/Setting.aspx" title="设置" description="" />
<siteMapNode url="~/SiteMasterHomePage/Music.aspx" title="音乐" description="" />
<siteMapNode url="~/SiteMasterHomePage/Album.aspx" title="相册" description="" />
<siteMapNode url="~/SiteMasterHomePage/LeaveMessage.aspx" title="留言" description="" />
<siteMapNode url="~/SiteMasterHomePage/Hobby.aspx" title="爱好" description="" />
<siteMapNode url="~/SiteMasterHomePage/UpLoad.aspx" title="上传" description="" />
<siteMapNode url="~/SiteMasterHomePage/Appreciate.aspx" title="欣赏" description="" />
<siteMapNode url="~/SiteMasterHomePage/Chat.aspx" title="聊天" description="" />
<siteMapNode url="~/SiteMasterHomePage/Query.aspx" title="查询" description="" />
等都没有</siteMapNode>啊,怎么要在后面加一个</siteMapNode>呢?我是知其然而不知其所以然,一楼的高手能给我详细说说吗???
wptad 2009-05-24
  • 打赏
  • 举报
回复
建议用VS编写XML,这样可以自动提示错误。
wptad 2009-05-24
  • 打赏
  • 举报
回复

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >

<siteMapNode url="~/Default.aspx" title="首页" description="">


<siteMapNode url="~/SiteMasterHomePage.aspx" title="站长主页" description="">
<siteMapNode url="~/SiteMasterHomePage/Setting.aspx" title="设置" description="" />
<siteMapNode url="~/SiteMasterHomePage/Music.aspx" title="音乐" description="" />
<siteMapNode url="~/SiteMasterHomePage/Album.aspx" title="相册" description="" />
<siteMapNode url="~/SiteMasterHomePage/LeaveMessage.aspx" title="留言" description="" />
<siteMapNode url="~/SiteMasterHomePage/Hobby.aspx" title="爱好" description="" />
<siteMapNode url="~/SiteMasterHomePage/UpLoad.aspx" title="上传" description="" />
<siteMapNode url="~/SiteMasterHomePage/Appreciate.aspx" title="欣赏" description="" />
<siteMapNode url="~/SiteMasterHomePage/Chat.aspx" title="聊天" description="" />
<siteMapNode url="~/SiteMasterHomePage/Query.aspx" title="查询" description="" />
</siteMapNode>

<siteMapNode url="~/AddFriends.aspx" title="加为好友" description="">
<siteMapNode url="~/AddFriends.aspx/Setting.aspx" title="设置" description="" />
<siteMapNode url="~/AddFriends.aspx/Music.aspx" title="音乐" description="" />
<siteMapNode url="~/AddFriends.aspx/Album.aspx" title="相册" description="" />
<siteMapNode url="~/AddFriends.aspx/LeaveMessage.aspx" title="留言" description="" />
<siteMapNode url="~/AddFriends.aspx/Hobby.aspx" title="爱好" description="" />
<siteMapNode url="~/AddFriends.aspx/Appreciate.aspx" title="欣赏" description="" />
<siteMapNode url="~/AddFriends.aspx/Query.aspx" title="查询" description="" />
</siteMapNode>

<siteMapNode url="~/FriendsSpace.aspx" title="好友空间" description="">
<siteMapNode url="~/FriendsSpace.aspx/Setting.aspx" title="设置" description="" />
<siteMapNode url="~/FriendsSpace.aspx/Music.aspx" title="音乐" description="" />
<siteMapNode url="~/FriendsSpace.aspx/Album.aspx" title="相册" description="" />
<siteMapNode url="~/FriendsSpace.aspx/LeaveMessage.aspx" title="留言" description="" />
<siteMapNode url="~/FriendsSpace.aspx/Hobby.aspx" title="爱好" description="" />
<siteMapNode url="~/FriendsSpace.aspx/Appreciate.aspx" title="欣赏" description="" />
<siteMapNode url="~/FriendsSpace.aspx/Query.aspx" title="查询" description="" />
<siteMapNode url="~/FriendsSpace.aspx/Chat.aspx" title="聊天" description="" />
</siteMapNode>

</siteMapNode>

</siteMap>



“siteMapNode”与结束标记“siteMap”不匹配
加一个</siteMapNode> 与之对应就OK了

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧