views:

484

answers:

2

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/SiteMap-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

A: 

Have you confirmed that the SiteMap bits work out of the box with ASP.NET MVC?

Wyatt Barnett
I don't know what this means.. Please explain. Sitemap BITS?
Ali
A bit colloquial, but it means what it says. Another translation would be "Do you know if the Web Forms SiteMap control works in the very different ASP.NET MVC environment. Anyhow, queen3 answered the question a bit more eloquently.
Wyatt Barnett
Oh now I understand. Thank you very much for your response :)
Ali
+2  A: 

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

queen3
Thank you.. I see that for full features I need to use the MVC sitemap module. thank you.
Ali