Dynamic and static Views

Oct 9, 2009 at 3:42 PM
Edited Oct 9, 2009 at 3:45 PM

I have a view in my site which supports both creating users and editing existing users. I want this to show up as two separate pages in the sitemap. I feel like I should be able to do this using the XML:

        <mvcSiteMapNode title="Create User" controller="Security" action="EditUser" />
        <mvcSiteMapNode title="Edit User" controller="Security" action="EditUser"  
isDynamic="true" dynamicParameters="id" visibility="InSiteMapPathOnly"/>

This would map /Security/EditUser to a "Create User" breadcrumb and /Security/EditUser/5 to an "EditUser" breadcrumb, which should not show up in the site map.  However, I get duplicate URL errors when doing this, and either line alone will happily handle both cases (which makes me wonder what the "isDynamic" flag is actually doing).

 

Is this possible to do?

Coordinator
Oct 12, 2009 at 7:05 AM

IsDynamic actually links all URLs with specific paramteres to one sitemap node. In your case, I would use

<mvcSiteMapNode title="Create User" controller="Security" action="EditUser"  
        isDynamic="true" dynamicParameters="id" />

and then set the SiteMap.CurrentNode titlte to either create or edit in teh action method.