title: Load more data through Ajax call on button click in MVC 4
body: <p>I am trying to show 6 record in a HRML table with a button as LoadMore. On every load more click it has to fetch another 6 record. I tried as follows </p>
  
  <p><strong>In Controller</strong></p>
  
  <pre><code>[HttpGet]
  private JsonResult GetTweetData(int count)
  {
      try
      {
          using (var context = new DbContext())
          {
              var countData = context.ObjTwitterDatas.Count();
              var count1 = 6 * count; // as default is 0 it will give 0-6 record
              var query = context.ObjTwitterDatas.Where(x =&gt; x.TwitterDataId &gt;= count1 &amp;&amp; x.TwitterDataId &lt;= countData).Take(6);
              var dataContainer3 = query.ToList();
              return Json(dataContainer3, JsonRequestBehavior.AllowGet);
          }
      }
      catch (Exception e)
      {
         return Json(new { success = false, ex = e.Message }, JsonRequestBehavior.AllowGet);
      }
  }
  </code></pre>
  
  <p><strong>Ajax call in ready method</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          $.ajax({
              type: "GET",
              url: '@Url.Action("GetTweetData" ,"Home")',
              contentType: "application/json; charset=utf-8",
              data: { count: 0}, // The count should be dynamic on load more to ferch next 6 record on button click
              dataType: "json",
              success: function (data) {
                 if(data.length&gt;0){
                      //Appending Data in Table
                  }
                  else{
                      alert('No More Records to Load')
                  }
              },
              error: function () {
                  alert("Error");
              }
          });
      });
       $('#Btn-More').on("click", function () {
           // Calling same method to fetch but not able to make properly to get more 6 record eg. 7-12
      });
  &lt;/script&gt;
  </code></pre>