Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated Links are wrong #98

Open
mhkarami opened this issue Dec 26, 2021 · 4 comments
Open

Generated Links are wrong #98

mhkarami opened this issue Dec 26, 2021 · 4 comments

Comments

@mhkarami
Copy link

mhkarami commented Dec 26, 2021

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 mhkarami changed the title Generated Links is wrong Generated Links are wrong Dec 26, 2021
@lapellaniz
Copy link

@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.

@scott-724
Copy link

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

@savva-andreas
Copy link

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);

@mhkarami
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants