<script type="text/javascript"> function AddItemToCart() { var itemId = $('[id$="lblBookName"]').val(); var itemName = $('[id$="lblPrice"]').val(); var itemPrice = $("#txtimg").val(); $.ajax({ type: "POST", traditional: true, url: "repeater.aspx/AddItemToCart", data: "{'Id':'" + itemId + "','Name':'" + itemName + "','Price':'" + itemPrice + "'}", contentType: "Application/json; charset=utf-8", datatype: "json", success: function (data) { $('#tblData').Html(data.d); }, }); }
and this is the repeater control i think i not access these contols properly but me not any idea how to access these in ajax funtion. <asp:Label ID="lblBookName" runat="server" Text='<%# Bind("ItemName") %>'></asp:Label> <asp:Label ID="lblCity" runat="server" Text=' <%# Bind("ItemQuantity") %>'></asp:Label> <asp:TextBox ID="txtimg" runat="server" Text='<%# Bind("ItemImage") %>'></asp:TextBox>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)