title: How to apply jQuery datatable in Entity Framework?
body: <p>I have tried to use jQuery datatable in Entity Framework.</p>
  
  <p>This is my code:</p>
  
  <pre><code>  @model IEnumerable&lt; MvcApplication6.Models.Student&gt;
  
      @{
      ViewBag.Title = "Index";
      Layout = "~/Views/Shared/_Layout.cshtml";
      }
  
      &lt;h2&gt;Index&lt;/h2&gt;
  
  
  
     &lt;!DOCTYPE html&gt;
  
     &lt;html&gt;
     &lt;head&gt;
     &lt;script type="text/javascript" charset="utf8" 
      src="https://code.jquery.com/jquery-1.12.4.js"&gt;&lt;/script&gt;
  
  
       &lt;link rel="stylesheet"  type="text/css" href="~/Content/DataTables/css/jquery.dataTables.css" /&gt;
        &lt;script src="~/Scripts/DataTables/jquery.dataTables.min.js"&gt;&lt;/script&gt;
  
  
  
  
  &lt;/head&gt;
  &lt;body&gt;
      @Html.ActionLink("Create New","create")
      &lt;table id="tbl" class="table table-striped table-bordered" &gt;
      &lt;thead&gt;
  
           &lt;tr&gt; 
               &lt;th&gt;
                   @Html.DisplayNameFor(model=&gt;model.StudentId)
               &lt;/th&gt;
  
               &lt;th&gt;
                   @Html.DisplayNameFor(model=&gt;model.FirstName)
               &lt;/th&gt;
                &lt;th&gt;
              @Html.DisplayNameFor(model =&gt; model.LastName)
          &lt;/th&gt;
  
          &lt;th&gt;
              @Html.DisplayNameFor(model =&gt; model.Age)
          &lt;/th&gt;
          &lt;th&gt;
              @Html.DisplayNameFor(model =&gt; model.Gender)
          &lt;/th&gt;
          &lt;th&gt;
              @Html.DisplayNameFor(model =&gt; model.Batch)
          &lt;/th&gt;
          &lt;th&gt;
              @Html.DisplayNameFor(model =&gt; model.Address)
          &lt;/th&gt;
          &lt;th&gt;
              @Html.DisplayNameFor(model =&gt; model.Class)
          &lt;/th&gt;
          &lt;th&gt;
              @Html.DisplayNameFor(model =&gt; model.School)
          &lt;/th&gt;
          &lt;th&gt;
              @Html.DisplayNameFor(model =&gt; model.Domicile)
          &lt;/th&gt;
                &lt;th&gt;
            Actions
          &lt;/th&gt;
           &lt;/tr&gt;
  
      &lt;/thead&gt;
      &lt;tbody&gt;
          @foreach(var item in Model)
          {
  
              &lt;tr&gt;
                   &lt;td&gt;@Html.DisplayFor(model=&gt;item.StudentId)&lt;/td&gt;
  
                  &lt;td&gt;@Html.DisplayFor(model=&gt;item.FirstName)&lt;/td&gt;
                    &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.LastName)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.Age)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.Gender)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.Batch)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.Address)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.Class)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.School)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.Domicile)
          &lt;/td&gt;
                  &lt;td&gt;
                       @Html.ActionLink("Edit", "edit", new  { id=item.id})|
                       @Html.ActionLink("Details", "details", new  { id=item.id})|
                       @Html.ActionLink("Delete", "delete",new  { id=item.id},new { onclick="return confirm('Are you sure?');"})
                  &lt;/td&gt;
              &lt;/tr&gt;
          }
  
      &lt;/tbody&gt;
  
  &lt;/table&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  
  
  
  &lt;script type="text/javascript" &gt;
   //jQuery.noConflict();
      $(document).ready(function ()
      {
  
          $("#tbl").DataTable();
      });
      $(document).ready(function () {
  
  
  
      })
  &lt;/script&gt;
  </code></pre>
  
  <p>jQuery datatable is not applied. I have used razor engine with Entity Framework. I have tried in aspx engine with ado.net, there the jQuery datatable worked properly.</p>