title: Bind Database data to Gridview using Jquery
body: <p>I am using <code>Jquery</code> to bind data into <code>Gridview</code>,On Checkbox Select Change i get data from Database and when i try pass those data  to <code>Jquery</code> to bind on Gridview Shows <code>Error</code>.</p>
  
  <blockquote>
  <pre><code>Jquery
  </code></pre>
  </blockquote>
  
  <pre><code> &lt;script type="text/javascript"&gt;
       $(document).on('click', 'input', function () {
           var key = $(this).find('lb' + this.id).text();
           var val = 'lb' + this.id;
           var lbltext = document.getElementById(val).innerHTML;
           $.ajax({
               type: "POST",
               url: "CandidateManagement.aspx/BindDatatable",
  
               data: '{value: "' + lbltext + '" }',
               contentType: "application/json; charset=utf-8",
               dataType: "json",
               success: function (details) {
                   alert(response.d.length);
                   for (var i = 0; i &lt; response.d.length; i++) {
  
                       $("#gvUserManage").append("&lt;tr&gt;&lt;td&gt;" + response.d[i].CandidateID + "&lt;/td&gt;&lt;td&gt;" + response.d[i].CandidateName + "&lt;/td&gt;&lt;td&gt;" + data.d[i].CurPosition + "&lt;/td&gt;&lt;/tr&gt;" + "&lt;tr&gt;&lt;td&gt;" + response.d[i].TotWorkExp + "&lt;/td&gt;&lt;td&gt;" + response.d[i].Skillset + "&lt;/td&gt;&lt;td&gt;" + data.d[i].USStatus + "&lt;/td&gt;&lt;/tr&gt;" + "&lt;/td&gt;&lt;td&gt;" + data.d[i].Location + "&lt;/td&gt;&lt;/tr&gt;" + "&lt;/td&gt;&lt;td&gt;" + data.d[i].ActiveResume + "&lt;/td&gt;&lt;/tr&gt;");
                   }
               },
               error: function (result) {
                   alert("Error");
               }
           });
  &lt;/script&gt;
  </code></pre>
  
  <blockquote>
    <p>aspx.cs</p>
  </blockquote>
  
  <pre><code>[WebMethod]
      public static Admin_CandidateManagement[] BindDatatable(string value)
      {
          string year = value.Substring(0, 2);
          int yearvalue = int.Parse(year);
          Admin_CandidateManagement admincandi = new Admin_CandidateManagement();
          string strSrcQry = admincandi.getSrcQryExpr(yearvalue);
  
  
          DataTable dt = new DataTable();
          Recruitment recOBJ = new Recruitment();
          admincandi.recOBJ.GetAllCandiDeatForAdvaceSearch(ref admincandi.dsCandiDeat, strSrcQry);
          //recOBJ.BindData(strSrcQry);
          dt = admincandi.dsCandiDeat.Tables[0];
  
          List&lt;Admin_CandidateManagement&gt; details = new List&lt;Admin_CandidateManagement&gt;();
          foreach (DataRow dtrow in dt.Rows)
          {
              Admin_CandidateManagement user = new Admin_CandidateManagement();
              user.CandidateID = dtrow["CandidateId"].ToString();
              user.CandidateName = dtrow["CandiName"].ToString();
              user.CurPosition = dtrow["CurrPosi"].ToString();
              user.TotWorkExp = dtrow["TotWrkExp"].ToString();
              user.Skillset = dtrow["SkillSet"].ToString();
              user.USStatus = dtrow["USStatus"].ToString();
              user.Location = dtrow["Location"].ToString() + "   " + dtrow["JobZipCode"].ToString();
              user.ActiveResume = dtrow["ActiveResume"].ToString();
              details.Add(user);
          }
        return details.ToArray();
  
      }
  </code></pre>