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

Mobeen RashidRank #1,213 · 1.5K reputationPosted Aug 23, 2017, 11:09 PM EDT
Pooja ChowdhuryRank #3,615 · 403 reputationPosted Aug 25, 2017, 11:12 PM EDT
Kailash Polai195 reputationPosted Aug 28, 2017, 10:47 PM EDT
Pooja ChowdhuryRank #3,615 · 403 reputationPosted Aug 29, 2017, 9:50 PM EDT
Kailash Polai195 reputationPosted Aug 31, 2017, 8:20 AM EDT
Pooja ChowdhuryRank #3,615 · 403 reputationPosted Sep 4, 2017, 4:09 AM EDT
Pooja ChowdhuryRank #3,615 · 403 reputationPosted Sep 6, 2017, 11:24 PM EDT
the error is
he model item passed into the dictionary is of type 'System.Collections.Generic.List`1[MvcApplication3.TeleInfo]', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[MvcApplication3.Models.MTeleInfo]'.