开发者

Actionlink doesn't post the id

开发者 https://www.devze.com 2023-03-19 23:16 出处:网络
In my view I have the following actionlink: Html.ActionLink(item.users.nickname, \"Details\", new { controller = \"Account\" }, new { id = item.users.id })

In my view I have the following actionlink:

Html.ActionLink(item.users.nickname, "Details", new { controller = "Account" }, new { id = item.users.id })

This should link to Acount/Details/2 but for some reason it only links to Account/Details I've even tried changing

 new { id = item.users.id }

into

new { id =开发者_高级运维 2 }

But that gives me the same outcome. I have the default MVC route in place but that shouldn't give any problem?


Try this

Html.ActionLink(item.users.nickname, "Details", new { controller = "Account" , id = item.users.id })


@Html.ActionLink("Details", "Details", new { id = item.users.id }) should do it. Where do you determine the text of your link here?

0

精彩评论

暂无评论...
验证码 换一张
取 消