.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> JQuery >> Post New QuestionBookmark and Share Subscribe to Forum

Autocomplete within gridview using Jquery in C#.net 3.5

Posted By: `Amit     Posted Date: February 02, 2011    Points:2   Category :JQuery
I want to apply autocomplete in gridview (in asp.net3.5 with C#) using jquery and this

gridview is within the ajax update panel<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>.

For this i am using method within the <ItemTemplate>

$(document).ready(function(){
$('[id$=txtItemCode]').autocomplete("SearchItem.aspx").result(function (event, data,

formatted) {
if (data) {
alert('Value: '+ data[1]);

}
else {
$('[id$=txtItemID]').val('-1');
}
});
});

since in gridview the textbox id is <asp:TextBox id="txtItemCode" /> but

on browser such as <input type="textbox" id="ctl00_otherName_101txtItemCode" />
and then for the next row same textbox id is now
<input type="textbox" id="ctl00_otherName_102txtItemCode" />

i tried
1. put this code within the <ItemTemplate>
2. <%= txtItemCode.ClientID %>
3. $("*[@id$=theGridId] input[@id$=txtItemCode]")

but autocomplete does not work in all the cases

plz help me.

Responses
Author: Narayanan             
Posted Date: September 26, 2011     Points: 20   

Hi,
Refer this site. It may be useful your task..
http://www.ashishblog.com/blog/search-sort-in-gridview-using-c-net-ajax-and-jquery/

Regards, Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend