title: how to bind data to listview in asp.net using jquery
body: <p>I have listview:</p>
  
  <pre><code>&lt;asp:ListView ID="lsvNews" runat="server" OnPagePropertiesChanging="lsvNews_PagePropertiesChanging"&gt;
      &lt;ItemTemplate&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;a href='&lt;%#Eval("Hyperlink") %&gt;' target="_blank"&gt;&lt;%#Eval("Title") %&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;%#string.Format("{0:MMMM d, yyyy}", Eval("CreatedDate"))%&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/ItemTemplate&gt;
      &lt;LayoutTemplate&gt;
          &lt;table&gt;
              &lt;tr runat="server" id="itemPlaceholder" /&gt;
          &lt;/table&gt;
      &lt;/LayoutTemplate&gt;
  &lt;/asp:ListView&gt;
  </code></pre>
  
  <p>and function get data using jquery</p>
  
  <pre><code>function GetNews(pageIndex) {
      $.ajax({
          type: "POST",
          url: "Default.aspx/GetData",
          data: '{pageIndex: ' + pageIndex + '}',
          contentType: "application/json; charset=utf-8",
          dataType: "json",
          success: OnSuccess,
          failure: function (response) {
              alert(response.d);
          },
          error: function (response) {
              alert(response.d);
          }
      });
  }
  function OnSuccess(response) { //????? }
  </code></pre>
  
  <p>function get data in codebehind:</p>
  
  <pre><code>[WebMethod]
  public static string GetData(int pageIndex)
  {
      DataSet ds = CreateDataSet(pageIndex);
      return ds.GetXml();
  }
  </code></pre>
  
  <p>Please tell me know the way bind data to <code>ListView</code> by code in function <code>OnSuccess</code>, thank :)</p>