开发者

Actionlink doesn't post the 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜