TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
aditya immadi
NA
215
23.7k
jquey autocompletion , method is not calling method
Jun 20 2016 1:17 AM
Hai all
i tried below code for jq autocompletion .but it will call my webservice method and jumps for error...
$(document).ready(function () {
// var v = $('#txtsearch').val();
$("#txtsearch").autocomplete({
source: function (request, response) {
$.ajax({
type: "GET",
contentType: "application/json",
url: "Default2.aspx/GetCourseNames",
data: "{'Course': '" + $('#txtsearch').val() + "'}",
//'" + document.getElementById('txtsearch').value + "'
dataType: "json",
success: function (data) {
response(data.d);
},
error: function (result) {
alert("Error......");
}
});
}
});
and my .cs page is
[System.Web.Services.WebMethod]
public List<string> GetCourseNames(string Course)
{
List<string> result = new List<string>();
string s = ConfigurationManager.ConnectionStrings["con"].ConnectionString;
SqlConnection con = new SqlConnection(s);
SqlCommand cmd = new SqlCommand("Sp_Search", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@CName", Course);
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
result.Add(dr["CourseName"].ToString());
}
return result;
i thought eveything is fine ....but it always jumps to error block while i m trying to enter text
any help
TIA
Reply
Answers (
1
)
calculator program like windows calculator
Audio file in .Net