I am creating an ASP.NET Web Application in mvc5 and i made a model class with a controller. My application is running but when i want to access my moviescontroller in url l
> Here EmployeeDetail is a table name and Employee is a model name. And
> ID,Branch,Salary and UID is a table field
public ActionResult Index()
{
List employees = context.EmployeeDetails.ToList();
List emp = new List();
foreach(EmployeeDetail item in employees)
{
emp.Add(new Employee
{
ID=Convert.ToInt32(item.ID),
Branch=item.Branch,`enter code here`
Salary=Conve`enter code here`rt.ToInt32(item.Salary),
UID = Convert.ToInt32(item.ID),
});
}
return View(emp);
}
> view page code
Index
@foreach (var emp in Model)
{
-
@Html.ActionLink(emp.Branch, "Details", new { id = emp.ID });
}