Unrecognized tag prefix or device filter (Visual Studio 2010)

This is my first attempt to use Visual Studio 2010 (Asp.Net 4.0). I want to use Ajax controls, mainly a ComboBox control.

I followed the step-by-step procedure described in this to download and install AjavControlToolkit.

I also followed this link for steps to add a ComboBox to my web page.

But no matter what I do, there is a green line under the control, and I get the error message "Unrecognized tag prefix or ajax device filter".

My web.config file looks like this:

<configuration> <system.web> <pages> <controls> <add tagPrefix="ajax" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"/> <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </controls> </pages> <compilation debug="true" targetFramework="4.0"> <assemblies> <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation> </system.web> </configuration> 

The aspx page looks like this:

  <form id="form1" runat="server"> <div> <asp:ScriptManager ID="sm" runat="server"></asp:ScriptManager> <ajax:ComboBox runat="server" AutoCompleteMode="SuggestAppend"> <asp:ListItem>ddd</asp:ListItem> <asp:ListItem>fff</asp:ListItem> <asp:ListItem>gggg</asp:ListItem> <asp:ListItem>hhhhh</asp:ListItem> </ajax:ComboBox> </div> </form> 

I even tried to delete the schema files from C: \ Documents and Settings \ xxx \ Application Data \ Microsoft \ VisualStudio \ 10.0 \ ReflectedSchemas.

Please help me in successfully implementing the Combobox control. Thanks!

Edited by:

As another approach, I created a new website and installed the latest version of AjaxControlToolkit using NuGet . I rebuilt the solution. I still could not see the Ajax controls in intellisense. Is there anything else that needs to be done to implement it? Please, help!

+4
source share
5 answers

If you are using Visual Studio 2010, I recommend downloading AJAXControlToolkit from Nuget a specified in this post ( link ).

Yesterday I stumbled upon the same problem, and it worked changing the prefix to " ajaxToolkit " and performing this task for the script manager, as Stephen Walter shows in this post ( ) Instead of ScriptManager use ToolScriptManager.

 <ajaxToolkit:ToolScriptManager id="id12" runat="server"/> 
+3
source

Although the time seemed to have passed for this, I had a similar problem, which after some “common sense” thought was resolved, and this could help someone else.

Such problems are often caused by the fact that the page does not load properly, loading controls, etc. or with errors in the format. Everything that prevents the IDE from correctly analyzing the page.

In my case, the page with the problematic control was the main page. For some reason, there was a problem with the resolution of the web instance on the main page. The title of the main page (i.e. the "Master" tag at the top of the page) was underlined with an error related to the inability to map the site to a specific IIS metabase key (for example, LM / W3SVC / 12 or any other).

Although I don’t know why this happened (it seemed to happen after stopping the debugging session using IIS Express), switching the solution to "Visual Studio Development Server" (ie cassini) and restarting the site resolved the link to the main page and therefore the page with the problem may correctly load the home page, and problems with unrecognized tags have disappeared.

Therefore, check all errors on the page itself in the <% @%> tags at the top of the page, and also mark "level up" on the main pages.

+2
source

Your <ajax:ComboBox /> missing the ID attribute.

 ... <ajax:ComboBox ID="MyComboBox" runat="server" AutoCompleteMode="SuggestAppend"> ... 

To force ajax tag prefix registration, you can add it to your page

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

If the problem persists, you need to check if the appropriate assembly is available.

0
source

In my case, I got this error after adding a page using the Telerik Scheduler Add Script. I resolved it by adding the following line to the aspx file, immediately below the line <% Page ...> -

 <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
0
source

Old thread but new answer :)

Get into an identical issue. The problem was that the extra lines were copied to Web.Config by mistake. This made the configuration section invalid.

Fixed strings and asp tags that were once recognized by intellisense.

0
source

Source: https://habr.com/ru/post/1398194/


All Articles