Gaurav Raj

Gaurav Raj

  • 1.4k
  • 475
  • 35.8k

command argument not work in clone datalist

May 4 2018 1:52 AM
  1. success: function (response) {
  2. var JqueryXml = response.d;
  3. var dlmycart = $('#DataList3');
  4. for (var i = 0; i < JqueryXml.length; i++) {
  5. var row = dlmycart.find('tr').eq(0).clone(true);
  6. $(".img11", row).attr("src", JqueryXml[i].UserPic);
  7. $(".name11", row).html(JqueryXml[i].Name);
  8. $(".contry11", row).html(JqueryXml[i].Country);
  9. $(".follower11", row).html(JqueryXml[i]);
  10. dlmycart.append(row);
  11. }
  1. <asp:DataList ID="DataListPeopleUmay" runat="server">
  2. <ItemTemplate>
  3. <table class="table" style="margin-top: -5px; margin-bottom: -10px;">
  4. <tr>
  5. <td>
  6. <a href="#">
  7. <asp:Image ID="ImgPeople" runat="server" Width="50px" Height="50px" CssClass="People-Know img-thumbnail" ImageUrl='<%# Eval("Pic") %>' />
  8. </a>
  9. </td>
  10. <td>
  11. <asp:LinkButton ID="LinkButton1" runat="server" CssClass="profile-name" CommandArgument='<%# Eval("Id") %>' Text='<%# Eval("Name") %>' OnClick="LbtnName_Click"></asp:LinkButton>
  12. <br />
  13. <asp:Literal ID="Literalcountry" runat="server" Text='<%# "Live in "+Eval("Counttry") %>'></asp:Literal>
  14. </td>
  15. <td>
  16. <asp:Button ID="BtnAddfrd" runat="server" Text="Follow" CssClass="btn btn-sm btn-color follow" Style="float: right; margin: 10px;" CommandArgument='<%# Eval("Id") %>' OnClick="BtnAddfrd_Click" />
  17. </td>
  18. </tr>
  19. </table>
  20. </ItemTemplate>
  21. </asp:DataList>