This is a migrated thread and some comments may be shown as answers.

[Solved] Support for Areas in XmlWebsiteMap

4 Answers 100 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Niels Schneider
Top achievements
Rank 1
Niels Schneider asked on 25 Feb 2010, 09:31 AM
Hi,

Is there support in the extensions (Sitemap) for ASP.Net MVC 2 Areas. If so a code example would be appreciated. Using a route in a XmlSiteMapNode results in a null ref exception.

I'm using VS2010 RC2.

Kind regards,

Niels

4 Answers, 1 is accepted

Sort by
0
Accepted
Kazi Manzur Rashid
Telerik team
answered on 02 Mar 2010, 01:47 AM
Hi Niels Schneider,

Area support will be added in the next drop. You will define the xml site map with the following:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap>
    <siteMapNode title="Home">
        <siteMapNode title="Main" controller="Home" action="Index">
            <routeValues>
                <area/>
           </routeValues>
       </siteMapNode>
      <siteMapNode title="Area" controller="AreaHome" action="Index">
           <routeValues>
              <area>MyArea</area>
          </routeValues>
      </siteMapNode>
    </siteMapNode>
</siteMap>

Sincerely yours,
Kazi Manzur Rashid
the Telerik team


Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Niels Schneider
Top achievements
Rank 1
answered on 02 Mar 2010, 09:03 AM
Hello Kazi,

Thank you for your answer. Your solution works already in the 2010 Futures release.

The implementation isn't making the the sitemap more readable however. it would be nicer to have an additional attribute in the siteMapNode which is added to the routeValues by to framework. Like this:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap>
    <siteMapNode title="Home">
          <siteMapNode title="Main" controller="Home" action="Index" area=""/>
          <siteMapNode title="Area" controller="AreaHome" action="Index" area="MyArea"/>
    </siteMapNode>
</siteMap>


Kind Regards,

Niels

ps. I'm missing your blog entries for a while. Are you gona write something soon? 
0
Kazi Manzur Rashid
Telerik team
answered on 02 Mar 2010, 10:43 AM
Hello Niels Schneider,

Okay Area has been promoted to node level as per your suggestion.

re: You will see something interesting soon in my blog.

Best wishes,
Kazi Manzur Rashid
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Niels Schneider
Top achievements
Rank 1
answered on 02 Mar 2010, 11:52 AM
Kazi,

Nice. Thank you.

Keep an eye on your blog.

Kind Regards,

Niels
Tags
General Discussions
Asked by
Niels Schneider
Top achievements
Rank 1
Answers by
Kazi Manzur Rashid
Telerik team
Niels Schneider
Top achievements
Rank 1
Share this question
or