title: How to Bind ul tag using jquery in asp.net C#
body: <p>I am working on an asp.net application where i have to bind the ul tag using the jquery. Inside the ul tag i want to bind images coming from the database. Here is my ul tag in the application</p>
  
  <pre><code>&lt;ul class="qv_carousel d_inline_middle" id="ulProductImages"&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Here is my code in jquery to bind the ul tag</p>
  
  <pre><code>function BindImage(id) {
  
      $.ajax({
          type: "POST",
          contentType: "application/json; charset=utf-8",
          url: "/Default.aspx/SelectProductImages",
          data: "{'UID':'" + id + "'}",
          dataType: "json",
          async: true,
          success: OnImageSuccess,
          error: OnImageError,
          failure: function (response) {
              alert('Fail');
          }
      });
      function OnImageSuccess(response) {
  
          var ulimage = document.getElementById("ulProductImages");
  
          $.each(response.d, function (key, value) {                
              ulimage.append("&lt;li&gt;&lt;/li&gt;").append("&lt;img src=" + value.ProductImage + " style=width:50px height:50px &gt;");
          })
  
      }
      function OnImageError(response) {
          alert(response.d);
      }
  }
  </code></pre>
  
  <p>this is the webmethod i have used call the data from the database</p>
  
  <pre><code>[System.Web.Script.Services.ScriptMethod()]
      [System.Web.Services.WebMethod(enableSession: true)]
      public static ProductImages[] SelectProductImages(string UID)
      {
          DataTable dt = new DataTable();
          List&lt;ProductImages&gt; details = new List&lt;ProductImages&gt;();
  
          //HtmlAnchor a = new HtmlAnchor();
          //a.InnerHtml
  
          dt = new ProductImages().SelectByProduct(Convert.ToInt64(UID));
  
          foreach (DataRow dtrow in dt.Rows)
          {
              ProductImages objProductImage = new ProductImages();
              objProductImage.ProductImage = dtrow["ProductImage"].ToString();
              details.Add(objProductImage);
          }
          return details.ToArray();
      }
  </code></pre>
  
  <p>When i have placed a debugger around the above webmethod then the controller goes there and fetch data from data from data from successfully. And  then it goes to OnImageSuccess method inside jquery but the ulProductImages tag is getting bind. Plese help me someone here.</p>