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
Hazel Mahmud
1.4k
315
70k
json autocomplete doesn't accept certain letter
Mar 22 2015 12:11 AM
hello..
i have a webservice that retrieve username. i manage to call it to a autocomplete textbox using json but it doesn't accept certain letter, e.g : a,d,n,i. why is that?.. how to fix it?.. below are my codes :
webservice.asmx
[WebMethod]
public List<string> GetStaffName(string name)
{
using (AseConnection persisConn = ClassConn.GetPersisConnection())
{
AseDataAdapter da = new AseDataAdapter();
persisConn.Open();
da.SelectCommand = new AseCommand("select name = ltrim(f786desc+' '+ f630nama) from t630staf, t786gelaran where f786kdgelar =* f630kdgelar and f630status != '9' AND f630nama like (LOWER('%@SearchName%')) union SELECT name = f620nama FROM t620sambilan where f620kdstatus <> '9' AND f620nama like (LOWER('%@SearchName%')) order by name", persisConn);
DataTable dt = new DataTable();
da.Fill(dt);
List<string> staffs = new List<string>();
for (int i = 0; i < dt.Rows.Count; i++)
{
staffs.Add(dt.Rows[i]["name"].ToString());
}
return staffs;
}
}
aspx code :
<script type="text/javascript" >
$(function () {
$('#<%= txtName.ClientID %>').autocomplete({
source: function (request, respponse) {
$.ajax({
url: "AutoComplete.asmx/GetStaffName",
data: "{'name' : '" + request.term + "'}",
type: "POST",
dataType: "json",
contentType: "application/json;charset=utf-8",
success: function (result) {
respponse(result.d);
},
error: function (result) {
alert('There is a problem processing your request');
}
});
}
});
});
Reply
Answers (
3
)
Convert Autohotkey code to c# code
C# working .with .GIF in transparent form