DoreWetsgease
New Member
I want to bind my datalist in jquery. Here is my client side code:\[code\]<head> <script src="http://stackoverflow.com/questions/12677249/jss/jquery.js" type="text/javascript"></script> <script type="text/javascript"> $(function () { $.ajax({ type: "POST", url: "WebForm1.aspx/GetProducts", data: '{}', 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) { $("[id*=dlOnFrontPageProducts]").attr("border", "1"); var xmlDoc = $.parseXML(response.d); var xml = $(xmlDoc); var customers = xml.find("Table1"); var row = $("[id*=dlOnFrontPageProducts] tr:last-child").clone(true); $("[id*=dlOnFrontPageProducts] tr:last-child").remove(); $.each(customers, function () { alert(this); var customer = $(this); $(".Name", row).html(customer.find("Name").text()); $(".BrandName", row).html(customer.find("BrandName").text()); $(".MarketPrice", row).html(customer.find("MarketPrice").text()); $(".CurrencyShortName", row).html(customer.find("CurrencyShortName").text()); $(".Price", row).html(customer.find("Price").text()); $(".WindowImageUrl", row).html(customer.find("WindowImageUrl").text()); $(".SaleCount", row).html(customer.find("SaleCount").text()); $(".IsActive", row).html(customer.find("IsActive").text()); $("[id*=dlOnFrontPageProducts]").append(row); row = $("[id*=dlOnFrontPageProducts] tr:last-child").clone(true); }); } </script></head><body> <asp
ataList runat="server" ID="dlOnFrontPageProducts" RepeatColumns="4" RepeatDirection="Horizontal" RepeatLayout="Table" EnableTheming="True" OnItemDataBound="dlChanceProducts_ItemDataBound"> <ItemTemplate> <div class="box-product fixed"> <div class="prod_hold"> <a class="wrap_link" href="http://stackoverflow.com/questions/12677249/ProductDetail.aspx?prid=<%# Eval("ProductId") %>"><span class="images"> <asp:Image runat="server" ID="imgWindow" /></span> </a> <div class="pricetag_small"> <span class="old_price"> <%# Eval("MarketPrice")%><%# Eval("CurrencyShortName")%></span> <span class="new_price"> <%# Eval("Price", "{0:n}")%> <%# Eval("CurrencyShortName")%></span> </div> <div class="info"> <h3> <%# Eval("Name") %></h3> <p> <%# Eval("BrandName")%></p> <a class="add_to_cart_small" href="http://stackoverflow.com/core/ajaxresult.aspx?act=prod&prid=<%#Eval("ProductId")%>"> Sepete Ekle</a> <a class="wishlist_small" href="http://stackoverflow.com/questions/12677249/#">Listeme Ekle</a> <a class="compare_small" href="http://stackoverflow.com/questions/12677249/#">Kar??la?t?r</a> </div> </div> </div> <div class="clear"> </div> </ItemTemplate> </asp
ataList></body>\[/code\]My returned data is correct but datalist doesn't bind. Do you have any suggestion?

