gpt4 book ai didi

asp.net-mvc - MVC ActionLink 如何指定文本、 Action 名称、 Controller 和 html 属性

转载 作者:行者123 更新时间:2023-12-04 17:38:59 27 4
gpt4 key购买 nike

我一直在尝试做一个 Action 链接,如:

<li>@Html.ActionLink("Home", "Index", "Invoice", new { id = "homelink" })</li>

所以我所拥有的是linkText、一个actionname、一个 Controller 名称和一个链接id。

但是,没有与此匹配的签名。最接近的是 Controller 名称和 htmlattributes 之间的路由值。不过,我没有任何需要放入的路由值。

有人可以告诉我如何最好地解决这个问题吗?

最佳答案

将路由值设置为 null一切顺利!

@Html.ActionLink("Home", "Index", "Invoice", null, new { id = "homelink" })

关于asp.net-mvc - MVC ActionLink 如何指定文本、 Action 名称、 Controller 和 html 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8885969/

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