Razor actionlink autogenerating ?length=7 in URL?

前端 未结 3 1675
无人及你
无人及你 2020-11-28 08:39

I have the link below on a razor page:

@Html.ActionLink(\"Create New Profile\", \"Create\", \"Profile\", new { @class=\"toplink\" })

It app

3条回答
  •  一整个雨季
    2020-11-28 09:15

    I'm not sure the exact cause of this, but change it to:

    @Html.ActionLink("Create New Profile", "Create", "Profile", new {}, new { @class="toplink" })
    

    I don't know which overload MVC is picking when you leave off the last parameter (htmlattributes is the added one), but that will fix it. One of these days I'll investigate and figure out exactly what's going on.

提交回复
热议问题