Below is my code behind [ScriptMethod()] [WebMethod] public static List GetCustomerList(string prefixText) { List getCustomer = new List(); using (SqlConnection con = DBCS.GetDbCon()) { SqlCommand cmd = new SqlCommand("SELECT FullName FROM [dbo].[fmCustomer] WHERE FullName LIKE @term + '%'", con); cmd.CommandType = System.Data.CommandType.Text; con.Open(); cmd.Parameters.AddWithValue("@term", prefixText); using (SqlDataReader r = cmd.ExecuteReader()) { while (r.Read()) { getCustomer.Add(r["FullName"].ToString()); } } } return getCustomer; } below is my aspx:
But the result was my aspx lines that shows like below < ! D O C T Y P E h t m l > and so on
@@SwiftLearn Sys.Application.add_init(function () { $create(AjaxControlToolkit.AutoCompleteBehavior, { "completionInterval": 100, "completionSetCount": 2, "minimumPrefixLength": 1, "serviceMethod": "GetItemList", // Name of your server-side method "servicePath": "" // Path to your web service or set this to "ComplaintsBrowse.aspx" }, {}, null, $get("TextBox1")); }); Try adding this Javasript code to the client-side and don;t forget the tags and the ScriptManager reference
To download Ajax ToolKit dll file drive.google.com/file/d/1RF6je42KWes0C4-6RNdGpfm7BiAzepc9/view?usp=sharing
Hello, excellent tutorial. Can you provide us AjaxControlToolkit dll please?
are u find a ajaxcontrolkit dll
Sorry for delay. you can download from this link drive.google.com/file/d/1RF6je42KWes0C4-6RNdGpfm7BiAzepc9/view?usp=sharing
drive.google.com/file/d/1RF6je42KWes0C4-6RNdGpfm7BiAzepc9/view?usp=sharing
It works like a charm! Thanks
You are very kind. Thanks for your comment. Please keep connected!
Please does it work in Framework="4.7.2"? I have tried but it does not fetch from the DB
Please try and let us know. Thanks bro.
Really well made tutorial
Thanks for your comment. Please keep connected.
Perfectly working
So kind of you. Please keep connected 🙏
Sir Asp.net c# is good for back end development
As you think.
Hello,
Pleace, Can I get a VB version of this tutorial.
I write VB, and I am not getting it well.
Thank you
Hello,
*Please*, Can I get a VB version of this tutorial.
I write VB, and I am not getting it well.
Thank you
As soon as possible, I will make such tutorial.
It did not work. it brings up
Do you install ajax control toolkit dll file? In my end it is working well. thanks
Thanks
So kinds of you. Please keep connected!
Can I get code files
Simple code. Please try. thanks
Mine is not working. I followed all your steps.
Below is my code behind
[ScriptMethod()]
[WebMethod]
public static List GetCustomerList(string prefixText)
{
List getCustomer = new List();
using (SqlConnection con = DBCS.GetDbCon())
{
SqlCommand cmd = new SqlCommand("SELECT FullName FROM [dbo].[fmCustomer] WHERE FullName LIKE @term + '%'", con);
cmd.CommandType = System.Data.CommandType.Text;
con.Open();
cmd.Parameters.AddWithValue("@term", prefixText);
using (SqlDataReader r = cmd.ExecuteReader())
{
while (r.Read())
{
getCustomer.Add(r["FullName"].ToString());
}
}
}
return getCustomer;
}
below is my aspx:
But the result was my aspx lines that shows like below
<
!
D
O
C
T
Y
P
E
h
t
m
l
>
and so on
Please check once again. If you follow all the process definitely it will work. Check the autocomplete extender & put the service method.
it's not work.
Please check once again. If you follow all the process definitely it will work. Check the autocomplete extender & put the service method.
@@SwiftLearn Sys.Application.add_init(function () {
$create(AjaxControlToolkit.AutoCompleteBehavior, {
"completionInterval": 100,
"completionSetCount": 2,
"minimumPrefixLength": 1,
"serviceMethod": "GetItemList", // Name of your server-side method
"servicePath": "" // Path to your web service or set this to "ComplaintsBrowse.aspx"
}, {}, null, $get("TextBox1"));
}); Try adding this Javasript code to the client-side and don;t forget the
tags and the ScriptManager reference