Last post Apr 29, 2019 02:46 AM by Sherry Chen
Apr 26, 2019 07:20 PM|WilliamSnell|LINK
I have a List method that should grab all records tied to the logged-in user's account if no parameters are passed in. If an ID is passed in, then the list is filtered on that ID. I noticed some strange behavior when I made calls to this method first with
the ID, and then with no ID. When using a normal anchor tag in my menu it works as I expect:
<a class="menu-links" href="/Category/List">My Categories</a>
Clicking a link with the ID, and then clicking the menu link whose markup did NOT include the ID, loads the URL without the ID, as I'd expect.
But if I use the Tag Helper to create the anchor tag, the behavior changes:
<a asp-area="" asp-controller="Category" asp-action="List" class="menu-links">My Categories</a>
If I click a link that provides an ID for filtering, and then click on the menu link that has no ID, the ID is persisted from my last action. Even if I just hover over the menu item, I can see the ID in the path. This is NOT desired behavior in my application,
and I'm not sure why this would happen. Is there a reason for it, and does it serve a valid purpose? Is there a way to still use the Tag Helper and not wind up with this behavior?
Apr 29, 2019 02:46 AM|Sherry Chen|LINK
Hi WilliamSnell ,
It would be better if you could share a demo to reproduce your issue, currently, I fail to reproduce your issue with shared code.
Best Regards ,