thelarz/MvcBreadCrumbs

IsCurrenPage doesn't work correctly when breadcrumbs added manually

Opened this issue · 1 comments

I have the following in my controller
[BreadCrumb]
[System.Web.Mvc.Route("{id:guid}", Name="GetCustomerView")]
public async Task Customer(Guid id, bool isNew = false)
{
BreadCrumb.Clear();
BreadCrumb.Add(Url.Action("Customers", "Customers"), "Customer List");
BreadCrumb.Add(System.Web.HttpContext.Current.Request.Url.ToString(), "Customer Detail");
....
}

IsCurrenPage isn't comparing correctly for the last item. Not sure why hash aren't comparing correctly. I changed BreadCrumb.Display and BreadCrumb.IsCurrentPage to compare actual urls instead of hash and that seem to work for me but I don't know what the side effects might be.

Thanks!

Looks my fix only works if you manually add url as I did :(