Getting Started with Adobe After Effects - Part 6: Motion Blur

Upload Image Close it
Select File

I am Jalpesh Vadgama a Microsoft MVP for Visual C# and BrainBench Certified ASP.NET Developer having more then 6 years of experience in .NET Technology.
Browse by Tags · View All
BRH 79
#.NET 52
C#.NET 48
ASP.NET 4.0 31
VisualStudio 27

Archive · View All
December 2010 16
July 2011 13
April 2011 13
April 2012 12
January 2011 12
June 2011 11
May 2011 11
May 2012 8
February 2013 7
January 2013 7

Creating dynamic breadcrumb in mvc with mvcsitemap provider

Apr 9 2012 3:19AM by Jalpesh   

I have done lots breadcrumb kind of things in normal web forms I was looking for same for mvc. After searching on internet I have found one great nuget package for mvpsite map provider which can be easily implemented via site map provider. So let’s check how its works. I have create a new MVC 3 web application called breadcrumb and now I am adding a reference of site map provider via nuget package like following.

BreadCumb using site map provider in mvc

You can find more information about MVC sitemap provider on following URL.

So once you add site map provider. You will find a Mvc.SiteMap file like following.

Site map with mvc

And following is content of that file.

<?xml version="1.0" encoding="utf-8" ?>
<mvcSiteMap xmlns:xsi=""
            xsi:schemaLocation=" MvcSiteMapSchema.xsd"
  <mvcSiteMapNode title="Home" controller="Home" action="Index">
    <mvcSiteMapNode title="About" controller="Home" action="About"/>

So now we have added site map so now its time to make breadcrumb dynamic. So as we all know that with in the standard mvc template we have action link by default for Home and About like following.

<div id="menucontainer">
    <ul id="menu">
        <li>@Html.ActionLink("Home", "Index", "Home")</li>
        <li>@Html.ActionLink("About", "About", "Home")</li>

Now I want to replace that with our sitemap provider and make it dynamic so I have added the following code.

<div id="menucontainer">

That’s it. This is the magic code @Html.MvcSiteMap will dynamically create breadcrumb for you. Now let’s run this in browser. You can see that it has created breadcrumb dynamically without writing any action link code.

BreadCumb with mvc

So here you can see with MvcSiteMap provider we don’t have to write any code we just need to add menu syntax and rest it will do automatically. That’s it. Hope you liked it. Stay tuned for more till then happy programming.

Shout it

Tags: #ASP.NET, ASP.NET MVC, BreadCrumb,

15 · 11% · 3548
2 Readers Liked this
Jacob Sebastian Liked this on 4/10/2012 1:20:00 PM
Profile · Blog · Facebook · Twitter
Guru Samy Liked this on 4/11/2012 12:27:00 AM
Profile · Blog


Your Comment

Sign Up or Login to post a comment.

"Creating dynamic breadcrumb in mvc with mvcsitemap provider" rated 5 out of 5 by 2 readers
Creating dynamic breadcrumb in mvc with mvcsitemap provider , 5.0 out of 5 based on 2 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]