Error creating custom SiteMapNodeModel Type error

Nov 4, 2010 at 5:10 PM

I'm attempting to implement a custom SiteMapNodeModel template.  I took SiteMapNodeModel and cloned it to CompleteSiteMapNodeModel.  Then I changed my call from Html.DisplayFor(m=>node.Children) to Html.DisplayFor(m=>node.Children,"CompleteSiteMapNodeModel") and get the following error:

The model item passed into the dictionary is of type 'MvcSiteMapProvider.Web.Html.Models.SiteMapNodeModelList', but this dictionary requires a model item of type 'MvcSiteMapProvider.Web.Html.Models.SiteMapNodeModel'.

Weird part is CompleteSiteMapNodeModel is an exact (except for name) clone of SiteMapNodeModel.

Any idea where I went wrong?

Nov 4, 2010 at 8:21 PM

The SiteMapNodeModelList.ascx file should be cloned, the one you cloned is the template for 1 item, SiteMapNodeModelList.ascx is the one for a collection of items.