質問

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