Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 896159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:41:02+00:00 2026-05-15T14:41:02+00:00

I am using autocomplete extender, i write a webservice the webservice is working fine

  • 0

I am using autocomplete extender, i write a webservice the webservice is working fine when i run webservice. But when i run my aspx page it is not displaying any thing the autocomplete is not showing only text box is there. this is my code……

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class WebService : System.Web.Services.WebService 
{

    SqlConnection con;SqlDataAdapter da;
    public WebService () {

    //Uncomment the following line if using designed components 
    //InitializeComponent(); 
}

[WebMethod]
public string[] GetTitleInfo(string prefixText)
{
    int count = 10;
    string sqry = "select * from news_upload where newstitle like @prefixText";
    da = new SqlDataAdapter(sqry, "server=localhost;database=tfcnew;user id=sa;password=sql123");
    da.SelectCommand.Parameters.Add("@prefixText", SqlDbType.VarChar, 100).Value = prefixText + "%";
    DataTable dt = new DataTable();
    da.Fill(dt);
    string[] items = new string[dt.Rows.Count];
    int i = 0;
    foreach (DataRow dr in dt.Rows)
    {
        items.SetValue(dr["newstitle"].ToString (), i);
        i++;
    }
    return items;
}

this is (above) service.

    <asp:TextBox ID="txtcomplete" runat ="Server" ></asp:TextBox>
        <asp:AutoCompleteExtender ID="AutoCompleteExtender2" runat="server" MinimumPrefixLength ="1" ServiceMethod ="GetSuggestions" ServicePath="~/WebService2.asmx" TargetControlID ="txtcomplete" >
        </asp:AutoCompleteExtender> 

This is aspx code..

can u help me. thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T14:41:02+00:00Added an answer on May 15, 2026 at 2:41 pm

    Add “[System.Web.Script.Services.ScriptMethod]” before the class declaration

    [System.Web.WebService(Namespace = "http://tempuri.org/")] 
    [System.Web.WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] 
    [System.Web.Script.Services.ScriptMethod]
    public class WebService : System.Web.Services.WebService {
    ...
    ...
    ...
    

    if it is already in your code, You could check the service path. Use Fiddler or Firebug to see if there is an actual call to the service. if not working then set the servicepath from paga_Load event of your aspx page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load  
       If Not Page.IsPostBack() Then
          AutoCompleteExtender2.ServicePath = ResolveUrl("~/mywebservice.asmx")                    
       End If
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.