gpt4 book ai didi

asp.net-mvc - 为什么我的 MVC 操作链接将我带到具有长度查询字符串值的 URL?

转载 作者:行者123 更新时间:2023-12-02 01:33:30 26 4
gpt4 key购买 nike

关于这个,我真的无能为力。

简单地说,我正在尝试呈现此链接:

<a class="button active-button" href="/Home/Register">Register</a>

我的 ActionLink 看起来像这样:

@Html.ActionLink("Register", "Register", "Home", htmlAttributes: new { @class = "button active-button" })

呈现此链接:

<a class="button active-button" href="/Home/Register?Length=4">Register</a>

我不明白 QueryString 值的来源,所以我在哪里犯了错误?

最佳答案

发生这种情况是因为您调用了错误的 ActionLink 重载。

@Html.ActionLink("Register", "Register", "Home", null, new { @class = "button active-button" }) 

关于asp.net-mvc - 为什么我的 MVC 操作链接将我带到具有长度查询字符串值的 URL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32681405/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com