Mian Sahib Jan 0 Newbie Poster

me have a repeater which have labels and textboxes i want to access these controls values through ajax me have code which give insted of values Undefine my code are below
Inline Code Example Here

<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);

},
});
}

////i use these values in table which showes insted of values shows Undefine.. 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>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.