Here is my master.master page code-
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
here is my webservice.asmx page code--
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data;
using System.Configuration;
using System.Data.SqlClient;
using System.Web.Services.Protocols;
using System.Web.Script.Services;
///
/// Summary description for WebService
///
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class WebService : System.Web.Services.WebService {
public WebService () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
[System.Web.Script.Services.ScriptMethod()]
public List GetCompletionList(string prefixText, int count)
{
using (SqlConnection con = new SqlConnection())
{
con.ConnectionString = ConfigurationManager.ConnectionStrings["Constr"].ConnectionString;
using (SqlCommand com = new SqlCommand())
{
com.CommandText = "select SubCatname from [findeasy].[Sub_Category_Table] where " + "SubCatname like @Search + '%'";
com.Parameters.AddWithValue("@Search", prefixText);
com.Connection = con;
con.Open();
List countryNames = new List();
using (SqlDataReader sdr = com.ExecuteReader())
{
while (sdr.Read())
{
countryNames.Add(sdr["SubCatname"].ToString());
}
}
con.Close();
return countryNames;
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data;
using System.Configuration;
using System.Data.SqlClient;
using System.Web.Services.Protocols;
using System.Web.Script.Services;
///
/// Summary description for WebService
///
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class WebService : System.Web.Services.WebService {
public WebService () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
[System.Web.Script.Services.ScriptMethod()]
public List
{
using (SqlConnection con = new SqlConnection())
{
con.ConnectionString = ConfigurationManager.ConnectionStrings["Constr"].ConnectionString;
using (SqlCommand com = new SqlCommand())
{
com.CommandText = "select SubCatname from [findeasy].[Sub_Category_Table] where " + "SubCatname like @Search + '%'";
com.Parameters.AddWithValue("@Search", prefixText);
com.Connection = con;
con.Open();
List
using (SqlDataReader sdr = com.ExecuteReader())
{
while (sdr.Read())
{
countryNames.Add(sdr["SubCatname"].ToString());
}
}
con.Close();
return countryNames;
}
}
}
and I add a default page for debug the masterpage.
Please help ?????
g sPosted Apr 7, 2015, 10:57 AM
1.Ajax
http://dotnetdrizzles.blogspot.in/2014/11/suggestion-box-search-textbox-ajax.html
2.Master Page
http://dotnetdrizzles.blogspot.in/2014/12/auto-suggestion-search-textbox-in.html
Vithal WadjePosted Mar 24, 2015, 2:08 PM