16,004,854 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 8673923 (Top 3 by date)
Member 8673923
8-Apr-13 6:12am
View
I tried this
<asp:GridView ID="Gridview1" runat="server" AutoGenerateColumns="False"
onselectedindexchanged="Gridview1_SelectedIndexChanged" ShowFooter="True"
Width="1308px" >
<columns>
<asp:TemplateField HeaderText="Student Name">
<itemtemplate><%--
--%>
<input type="text" id="name" name="name" runat="server" class= "autosuggest" />
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
SearchText();
});
function SearchText() {
$('#<%=name.ClientID %>').autocomplete({
source: function(request, response) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "InsertPage.aspx/GetAutoCompleteData",
data: "{'username':'" + document.getElementById('name').value + "'}",
dataType: "json",
success: function(data) {
response(data.d);
alert(data.d);
},
error: function(result) {
alert("Error");
}
});
}
});
}
</script>
Is this correct? I am asking because I am getting the same error
Member 8673923
8-Apr-13 5:48am
View
An error is coming that The name 'name' does not exist in the current context???
Member 8673923
8-Apr-13 3:03am
View
Sir, I already tried this but after I added this ,the control is not going inside the web method only i.e the ajax is not loading at all