SmartBreadcrumbs icon indicating copy to clipboard operation
SmartBreadcrumbs copied to clipboard

Generated Links are wrong

Open mhkarami opened this issue 3 years ago • 4 comments

I use razor page .net core 5 . and SmartBreadcrumb version 3.6.1 Generated Breadcrumbs titles are correct but link are wrong I named my pages as A , B , C ,... this is the Generated Breadcrumbs titles : BASE / A / B / C Links : Base : https://localhost:5001/ A : https://localhost:5001/Administration/A/B/C B : https://localhost:5001/Administration/A/B/C C : is not active page url in C Position is https://localhost:5001/Administration/A/B/C

Base class :

    [DefaultBreadcrumb("BASE")]
    public class IndexModel : PageModel

A Class (And Same for B And C just change names and change FromPage):

    [Breadcrumb("A")]  // test [Breadcrumb("A", FromPage = typeof(Pages.IndexModel))]
    public class IndexModel : PageModel

in version 3.4.0 and 3.1.1 i do not have this problem but still pages with input parameter does not work and have same problem for example if page be like :

    public class IndexModel : PageModel{
        public void OnGet(long kpiId)
        {

generated link is wrong

mhkarami avatar Dec 26 '21 08:12 mhkarami

@mhkarami Did you ever get passed this issue? I found this library and decided to try it but I am seeing the same error. The titles are correct but the links are all wrong. All previous links use the current page's link except the default one which is correct.

lapellaniz avatar Sep 13 '22 16:09 lapellaniz

I am having this issue as well. The next to last breadcrumb is getting the link of the last breadcrumb entry.

scott-724 avatar Nov 30 '22 15:11 scott-724

Hi, have the same issue because we use route values, e.g. @page "/page/{aRouteValue}". The fix for my scenario was in SmartBreadcrumbs\src\Nodes\RazorPageBreadcrumbNode.cs change public override string GetUrl(IUrlHelper urlHelper) => urlHelper.Page(Path, RouteValues); to public override string GetUrl(IUrlHelper urlHelper) => urlHelper.Page(Path, urlHelper.ActionContext.HttpContext.Request.RouteValues);

savva-andreas avatar Mar 31 '23 11:03 savva-andreas

@lapellaniz I stopped using this library. after several years, I tempted to use this library again and the same error occurred to me again.

mhkarami avatar Nov 15 '23 19:11 mhkarami