gridview is within the ajax update panel
Expand|Select|Wrap|Line Numbers
- <asp:UpdatePanel ID="UpdatePanel1" runat="server">
- <ContentTemplate>
Expand|Select|Wrap|Line Numbers
- $(document).ready(function(){
- $('[id$=txtItemCode]').autocomplete("SearchItem.aspx").result(function (event, data,
- formatted) {
- if (data) {
- alert('Value: '+ data[1]);
- }
- else {
- $('[id$=txtItemID]').val('-1');
- }
- });
- });
on browser such as
Expand|Select|Wrap|Line Numbers
- <input type="textbox" id="ctl00_otherName_101txtItemCode" />
Expand|Select|Wrap|Line Numbers
- <input type="textbox" id="ctl00_otherName_102txtItemCode" />
1. put this code within the <ItemTemplate>
2. <%= txtItemCode.ClientID %>
3. jQuery("*[@id$=theGridId] input[@id$=txtItemCode]")
4. jQuery("*[id$=theGridId] input[id$=txtItemCode]")
5.jQuery.expr[':'].asp = function(elem, i, match) {
return (elem.id && elem.id.match(match[3] + "$"));
};
and $(":asp(txtItemCode)").autocomplete...
5.$('.txtItemCode').autocomplete("LookupCodes.aspx ?type=IC", { mustMatch: true })
but autocomplete for textboxfield in multiple rows does not work in all the cases