hi frnds ,I started a new project in .Net 3.5 version.I add a New Ajax Web Form Default2.aspx.

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}

I run PROJECT & it runs successfully.

Now i add webservice. It contains the in app_code folder.

using System;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;

/// <summary>
/// Summary description for WebService
/// </summary>
[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]
    public string HelloWorld() {
        return "Hello World";
    }
    
}

I run PROJECT & it runs successfully.

Now i drag AutoCompleteExtender on the form Default2.aspx. It contains error
Unknown server tag 'asp:AutoCompleteExtender'

Why the error is coming??Plz help me in sorting out! hi frnds help me.

Dani AI

Generated

Quick diagnosis: the parse error "Unknown server tag 'asp:AutoCompleteExtender'" means the page parser does not recognize that control under the asp: prefix — AutoCompleteExtender is part of the AJAX Control Toolkit, not the built-in asp set. was right to point toward a register directive, but that alone won't fix everything. Typical causes are: no reference to the toolkit DLL, the control tag prefix and register directive don't match, no ScriptManager on the page, or the web service/page-method used by the extender is not script-callable or has the wrong signature.

Essential checklist and minimal examples to get the extender working:

  • Confirm the project references the AjaxControlToolkit assembly and the DLL is in the Bin folder (use a version built for .NET 3.5).
  • Make sure a ScriptManager (or ToolkitScriptManager) is on the page before any extenders.
  • Use the same tag prefix you registered (do not use asp: for toolkit controls).
  • For service calls, point ServicePath to an ASMX or use a static page method; the called method must accept prefixText and count and return an array/list of strings.

Minimal markup example (assumes the toolkit is registered with the cc1 prefix):

<asp:ScriptManager runat="server" ID="ScriptManager1" />

<asp:TextBox runat="server" ID="txtSearch" />

<cc1:AutoCompleteExtender runat="server"
    TargetControlID="txtSearch"
    ServicePath="AutoCompleteService.asmx"
    ServiceMethod="GetCompletionList"
    MinimumPrefixLength="2"
    CompletionSetCount="10" />

Example service method signature expected by the extender:

[WebMethod]
public string[] GetCompletionList(string prefixText, int count)
{
    // return matching strings (e.g., query DB and return an array)
}

Additional notes: for ASMX calls the service class must be script-callable (enable the ScriptService behavior) and the ServicePath must point correctly to the .asmx; for page methods set ServicePath appropriately and make the method static. If the control still shows as unknown, re-check the tag prefix used in markup matches the register directive and rebuild the project so the IDE picks up the assembly.

hi frnds ,I started a new project in .Net 3.5 version.I add a New Ajax Web Form Default2.aspx.

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}

I run PROJECT & it runs successfully.

Now i add webservice. It contains the in app_code folder.

using System;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;

/// <summary>
/// Summary description for WebService
/// </summary>
[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]
    public string HelloWorld() {
        return "Hello World";
    }
    
}

I run PROJECT & it runs successfully.

Now i drag AutoCompleteExtender on the form Default2.aspx. It contains error
Unknown server tag 'asp:AutoCompleteExtender'

Why the error is coming??Plz help me in sorting out! hi frnds help me.

Hi there

Pls. page directives in your aspx page

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

Mark as solved if it helps you!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.