how to call action of other controller with parameters using action link in mvc razor ?

If we want to call action of same controller with parameters then from view the we use

@Html.ActionLink("LinkText","ActionName","ControllerName",new{id = idValue})

e.g.

@Html.ActionLink("Edit","Edit","Home",new{id = 3})

then link generated will be “http:localhost/Home/Edit/3

If we use same structure for calling action from another controller i.e.

@Html.ActionLink("Edit","Edit","Account",new{id = 3})

Then link generated will be “http:localhost/Home/Edit/3?Length=7

So to solve this we have to do this

@Html.ActionLink("Edit","Edit","Account",new{id = 3},new{})

This will generate correct link i.e. “http:localhost/Account/Edit/3

admin