In MVC Razor ActionLinke, it is a common requirement to pass parameter as a query string. It creates URL like below:
/Home/Edit/1
and of course basically it is <a href="/CodeTest/EditClass/1">Edit</a>
ActionLink provide different overloads, using one of them such links can be generated:
@Html.ActionLink("Home", "Edit", new {id=1})
Instead of hard coded strign a model property can also be used:
@Html.ActionLink("Home", "Edit", new {id=Model.Id})
Important
If you are using T4MVC templates is a little different from above examples, then you will code as per below example:
@Html.ActionLink("Edit",MVC.CodeTest.EditClass()
.AddRouteValue("id",1))
and using model:
@Html.ActionLink("Edit",MVC.CodeTest.EditClass()
.AddRouteValue("id",itm.ClassID))
For passing multiple parameters use AddRouteValues().