You must Sign In to post a response.
  • Category: ASP.NET

    Autocomplete textbox using jquery in asp net

    For autocomplete textbox i am using GenericHandler.ashx, jquery, StoreProcedure.

    public void ProcessRequest(HttpContext context)
    string term = context.Request["term"] ?? "";
    List<string> listCustomerName = new List<string>();

    string cs = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;

    using (SqlConnection conn = new SqlConnection(cs))
    SqlCommand cmd = new SqlCommand("searchCustomerDetails",conn);
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.Add(new SqlParameter()
    ParameterName ="@term",
    Value =term
    SqlDataReader rdr = cmd.ExecuteReader();
    while (rdr.Read())
    JavaScriptSerializer js = new JavaScriptSerializer();

    <script src=""></script>
    <link href="SearchCustomer/jquery-ui.css" rel="stylesheet" />
    <script src="SearchCustomer/jquery-ui.js"></script>

    <script type="text/javascript">
    $(document).ready(function () {
    source: 'CustomerHandler.ashx'


    Store Procedure

    create proc searchCustomerDetails
    @term nvarchar(50)
    select CustomerName from tblCustomerDetails
    where CustomerName like @term + '%'

    above code works fine in normal web page for auto suggestion through textbox but i am trying to add this code on Content page of master page it is not working.

    There are many ways to do same task, kindly give me solution for above code.
  • #769685
    you can refer parent object while you adding from content page in your script and that may give solution for you problem.

    also, if you can share us the error details then that might give hint to suggest suitable solution.

    B.Ramana Reddy

  • Sign In to post your comments