i create a loop to show a list
- <table>
- <tr>
- <th></th>
- <th>TeleGUID
- </th>
- <th>Screen Name
- </th>
- <th>Mobile Number
- </th>
- </tr>
- @foreach (var item in Model)
- {
- <tr>
- <td>
- @Html.ActionLink("Edit", "Edit", new { id = item.TeleGUID }) %> |
- @Html.ActionLink("Details", "Details", new { id = item.TeleGUID })%>
- </td>
- <td>
- @Html.DisplayFor(modelItem => item.TeleGUID)
- </td>
- <td>
- @Html.DisplayFor(modelItem => item.TeleName)
- </td>
- <td>
- @Html.DisplayFor(modelItem => item.TeleMob)
- </td>
- </tr>
- }
- </table>
controller code is
- [HttpGet]
- public ActionResult UserDetails()
- {
- UserdbEntities db = new UserdbEntities();
- var tasks = from t in db.UserInfoes
- select new
- {
- t.GUID,
- t.Name,
- t.Mob,
- };
-
- return View(tasks.ToList());
but i got an error