HTML.ActionLink method

前端 未结 10 1610
刺人心
刺人心 2020-11-22 11:07

Let\'s say I have a class

public class ItemController:Controller
{
    public ActionResult Login(int id)
    {
        return View(\"Hi\", id);
    }
}
         


        
10条回答
  •  执笔经年
    2020-11-22 11:47

    With MVC5 i have done it like this and it is 100% working code....

    @Html.ActionLink(department.Name, "Index", "Employee", new { 
                                departmentId = department.DepartmentID }, null)
    

    You guys can get an idea from this...

提交回复
热议问题