Hi i have a code which gets the user details and , i have a view which reads the details from the controller. but i am getting this error.

My Controller looks like this

  var details =  
                (from u in db.Users
                 select new
                 {
                     u.UserID,
                     u.Name,
                     u.UserEmail,
                     u.UserAddress,
                     u.UserMobile,
                     u.UserCity,
                     u.RoleId
                 }).ToList();

            return View(details);



  @model IEnumerable<DueDimensions.Models.User>

@{
    ViewBag.Title = "UserDetailsDataView";
    Layout = "~/Views/Shared/AdminDashboardLayout.cshtml";
}

@section head{
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            $('#myDataTable').dataTable().makeEditable();
        });
    </script>
}

<div id="demo">
    <h1>Basic Example</h1>
    <table id="myDataTable" class="display">
        <thead>
            <tr>
                <th>Name</th>
                <th>User Name</th>
                <th>Email</th>
                <th>Address</th>
                <th>Mobile Number</th>
                <th>City</th>
                <th>Role</th>

            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr id="@item.UserID">
                    <td>@item.Name</td>
                    <td>@item.UserEmail</td>
                    <td>@item.UserAddress</td>
                    <td>@item.UserMobile</td>
                    <td>@item.UserCity</td>
                    <td>@item.Role</td>
                </tr>
            }
        </tbody>
    </table>
    <div class="add_delete_toolbar" />
</div>

when i run the project , am getting an error as heading. what will be the reason, your dynamic help would help me lot. i am working with jquery datatables.

advance Thanks

Related posts

Recent Viewed