In the current controller Views/Users I have

grid.Column(format: (item) => Html.ActionLink("Edit", "Edit", new { id = item.UserId }), style: "column-action"),

I have another view like Views/Comissions

So I want to add at the grid Html.ActionLink to up located controller

grid.Column(format: (item) => Html.ActionLink("Comission", "Index", "Comission", new { id = item.UserId }), style: "column-action")   

But I see wrong URL like

http://localhost:51381/Users?Length=16

instead of it should be like

http://localhost:51381/Comission/Index/123-sfsdf-2342342-ssdfsdf

Any clue how to fix it?

有帮助吗?

解决方案

The problem is that the method you are creating the link is using the incorrect overload of the Html.ActionLink.

You will need to add null

Take a look at this other question to see the problem.

其他提示

You need to add null as last argument (which stands for htmlArguments) to use the correct Html.ActionLink overload:

grid.Column(format: (item) => Html.ActionLink("Comission", "Index", "Comission", new { id = item.UserId }, /*here ->*/null), style: "column-action") 
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top