Mvc Core 2 has a bug that we cannot use page keyword so i changed it to pageid now that bug is fixed but I have a new bug
routes.MapRoute(
name: null,
template: "Community/Page{pageID}",
defaults: new { Controller = "Forum", action = "Home" });
routes.MapRoute(
name: "default",
template: "{controller=Forum}/{action=Home}/{id?}");
routes.MapRoute(
name: null,
template: "",
defaults: new { controller = "Forum", action = "Home", pageID = 1 });
routes.MapRoute(name: null, template: "{controller}/{action}/{id?}");
and my tag helper
[HtmlAttributeName(DictionaryAttributePrefix = "page-url-")]
public Dictionary<string, object> pageUrlValues { set; get; }
public override void Process(TagHelperContext context, TagHelperOutput output)
{
pageUrlValues["page"] = i;
I should get
url/Community/Page5
but what i get is
url/Community/Page1?page=5
this works fine but makes my mapping useless and if i changed page in tag helper to pageID the page's id now updated as expected to page5 / page4 etc but the content of these pages doesn't update only the content of page1 get displayed
it turns out that i forgot to update the controller's parameter page to pageid