-3

I'm using Action Link on my view and then it clicked it needs to go update view with Id.But it shows me the Length.

View

@Html.ActionLink("Update", "UpdateEmployee","Employee", new { id = item.EmpId })

When i click it it shows me the URL ,
http://localhost:7631/Employee/UpdateEmployee?Length=8

Because Length 8 is wrong and corret way is
http://localhost:7631/Employee/UpdateEmployee/1

UDP
  • 89
  • 2
  • 11

1 Answers1

2

I Found the Answer,

 @Html.ActionLink("Update", "UpdateEmployee","Employee", new { id = item.EmpId },null)
UDP
  • 89
  • 2
  • 11
  • If your view is in the same controller you can omit the controller name and use a shorter overload, @Html.ActionLink("Update", "UpdateEmployee", new { id = item.EmpId }) – Skye MacMaster May 04 '15 at 16:04