Click here to Skip to main content
16,004,854 members

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