开发者

Why is my Sitemap.CurrentNode null?

System.NullReferenceException: Object reference not set to an instance of an object.

Making the Sitemap.CurrentNode work in my code is oddly a problem.

I haven't figured out how to list code on STOF yet... so here is the code that will easily be displayed.

Title: "localhost/home.aspx/about"

Response.write(SiteMap.CurrentNode.Title)

Title: localhost/Web.sitemap "

siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMa开发者_C百科p-File-1.0"

siteMapNode url="localhost" title="ROOT" description="parent "

siteMapNode url="localhost/Home.aspx/about" title="About" description="mommy I'm cold "> /siteMapNode

/sitemap

MVC routing is used. routes.MapRoute("Default", "{controller}.aspx/{action}/{id}", New With {.controller = "Home", .action = "Index", .id = ""})

Thanks


Not every ASP.NET control works with ASP.NET MVC. You can check out this project to make it work: http://mvcsitemap.codeplex.com/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜