How to Pass parameters to Method using BreadCrumbs

Mar 28, 2011 at 2:14 PM
Edited Mar 28, 2011 at 2:28 PM


I'm using ASP.NET MVC 2.0 and MVCSitemap2.0

My BreadCrumb is displaying like in a page

DashBoard>>HotelPolicy>>ChildPolicy View"

Here HotelPricing has a method "Create" and accepts parameter HotelCode , the problem here is i unable to pass hotelcode for Hotelpricing Create method.when i click on HotelPolicy Link that should Navigate to http;//localhost:2287/Policy/HotelPolicy/Create/HTL9834.But when i click on HotelPolicy is redirecting to http;//localhost:2287/Policy/HotelPolicy/Create/. Here I should pass the parameters to Create method of HotelPolicy

MY complete APP structure is:


  <siteMap defaultProvider="MvcSitemapProvider">
        <add name="MvcSitemapProvider"
             siteMapFile="~/Web.Sitemap"  />



 <mvcSiteMapNode title="$resources:SiteMapResource,DashboardTitle"
                  visibility="InSiteMapPathOnly" changeFrequency="Always">

<mvcSiteMapNode title="$resources:SiteMapResource,HotelPolicyTitle"

<mvcSiteMapNode title="$resources:SiteMapResource,ChildPolicyCreateTitle"





Note: I did only Above thing in my application and i didnot touch controller


Mar 28, 2011 at 8:09 PM

In your HotelPolicy Controller, your Create Method needs a "HotelID" parameter.  That should at least get you the data.
How are you getting the ID in the first place?  I noticed ID as a dynamicparameter.  A bit more detail would be helpful. 

Mar 29, 2011 at 6:24 AM
Edited Mar 29, 2011 at 6:28 AM

Thanks tomcdona,


On dashBoard  i have some portlets which  contains predictive searches,so i can get  "Id( Ex: HotelID)" and can pass to my  create method of HotelPolicy Controller in normal wayand here i will pass only one ID  and that is dynamic .

In normal flow Breadcrumb display ing correctly..but when i click on HotelPolicy hyperlink in Breadcrumb .I unable to pass "Id " to my Create method

Is above Information Helpful?

Mar 29, 2011 at 6:01 PM

AH, ok.  I ran into a similar problem with specific drill down results for certain product categories.

Unfortunately, the only way I could actually get the breadcrumbs to do what I wanted was to create a Node for each entry.
So there exists in my code a DynamicNodeGenerator for each product in my databases, which allows all my breadcrumbs to display properly.

I haven't been able to figure out a better option myself, but maybe someone else here does.  I don't like the solution at all, but deadlines are deadlines......

Mar 30, 2011 at 6:29 AM
Edited Mar 30, 2011 at 6:30 AM


can i know How to generate node for each entry? and  also can give a  solution for how to generate dynamicnodegenetator to display breadcrumbs i can tryout in this way to resolve my problem.

or Is there any alternative way to resolve my solution.

Mar 30, 2011 at 1:27 PM

This is the best place to get started.

There's also a good demo in the project that comes with MvcSiteMap download.

Sep 13, 2011 at 8:26 AM
Edited Sep 13, 2011 at 8:27 AM

Can I have exact solution for my above specified Issue?