Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • each time the user navigate to an action the service will create new Breadcrumbs. Commented Apr 29, 2018 at 12:34
  • Yes. But object construction here is relatively cheap. If your site is high enough traffic to be concerned with this, you'll have measures in place like output caching to prevent this from ever being a problem. If you were desperate to prevent the complete rebuild, you could use a concurrent dictionary to store results based on URL. Commented Apr 29, 2018 at 14:33
  • This is a very simple and elegant way to generate and display breadcrumbs, but I'm having some weird artifacts (like double breadcrumbs -- e.g. "dashboard > dashboard" and no chain of crumbs --e.g. missing "home > other page > dashboard") I haven't gone much further on troubleshooting yet, and probably residual code from a previously installed breadcrumb nuget package I haven't removed yet... I'd like to show how to turn your _Partial into a Bootstrap styled breadcrumb string, and how to change the bootstrap separator character(s)... should I do that in a comment? Commented Oct 20, 2020 at 7:24
  • Hey @KrisBunda! Appreciate the comment. Turning this into a bootstrap style breadcrumb string should involve nothing more than altering Breadcrumbs.cshmtl. With respect to the artifacts, this solution is one dimensional in that it has no concept of "nesting". Barring that, check that you're following a standard mvc approach within your controllers. Commented Oct 20, 2020 at 9:14
  • There are major flaws in this approach. Firstly, it can only handle 2 pages. Secondly, when user moves from 1st page to 2nd page, the title of 1st breadCrumb becomes same as that of 2nd. Commented May 3, 2021 at 10:05