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
Jes Sie
738
1.2k
281.6k
AutoComplete TextBox Having 2 Parameters
Oct 30 2019 9:39 PM
Hello everyone!
I was able to create an autocomplete with a single parameter only using a generic handler and jquery. Below is my code snipet:
Generic handler
public
void
ProcessRequest(HttpContext context)
{
string
term = context.Request[
"term"
] ??
""
;
List<
string
> listCustomers =
new
List<
string
>();
using
(SqlConnection con = DBCS.GetDbCon())
{
SqlCommand cmd =
new
SqlCommand(
"spGetCustomers"
, con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(
"@term"
, term);
con.Open();
SqlDataReader rdr = cmd.ExecuteReader();
while
(rdr.Read())
{
listCustomers.Add(rdr[
"CustomerName"
].ToString());
}
}
JavaScriptSerializer js =
new
JavaScriptSerializer();
context.Response.Write(js.Serialize(listCustomers));
}
JQuery:
$(document).ready(
function
() {
$(
'#ContentPlaceHolder1_txtCustomerName'
).autocomplete({
source:
'/Handler/CustomerPolicyTransHandler.ashx'
});
});
Now, I need to create another autocomplete but this time there are 2 parameters. My problem is on the jquery side. How can do that in my jquery?
Thanks in advance for any assistance.
Reply
Answers (
1
)
How to fix heap inspection vulnerability in c#
Want to get user detail by access token using OAuth2.0