i have small webmethod returning simple dataset from sql table...
this works if i set asp.net framework as 3.5 but after setting it to 2.0 its not working
i have done below mention code on default.aspx page
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>AutoComplete Box with jQuery</title>
<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() {
alert('IN');
$(".autosuggest").autocomplete({
source: function (request, response) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "../Default.aspx/Mydata",
data: "{'username':'" + JSON.stringify(document.getElementById('txtSearch').value) + "'}",
dataType: "json",
success: function (data) {
response(data.d);
},
error: function (result) {
alert(result);
}
});
}
});
}
</script>
</head>
<body>
<form id="form1" runat="server">
<label for="tbAuto">
Enter UserName:
</label>
<input type="text" id="txtSearch" class="autosuggest" />
</form>
</body>
</html>