3

I have this in my Register

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

But when I drop and drag a scriptmanager into VS2010 i receieve the error ajax unknown server tag asp scriptmanager

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

changed it to

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

Still produces the error.

4 Answers 4

11

In your system.web you need to add:

<pages>
      <controls>
               <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      </controls>
  </pages>
6
  • i just saw that and changed it to, '<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>' However, this still produces the same error.
    – user222427
    Commented Nov 12, 2011 at 14:08
  • I added the script manager under my Ajax Extensions in my VS2010, does that help any?
    – user222427
    Commented Nov 12, 2011 at 14:14
  • Oskar, i must be on the same path you are, i added that to my web.config and then i got this in return The type or namespace name 'ScriptManager' does not exist in the namespace 'System.Web.UI' (are you missing an assembly reference? so then i added System.Web.Extensions and still got the error forums.asp.net/t/1070186.aspx/…
    – user222427
    Commented Nov 12, 2011 at 14:29
  • great did all of that and now Ajax disappeared from my toolbox
    – user222427
    Commented Nov 12, 2011 at 14:36
  • it still doesn't fix the problem
    – user222427
    Commented Nov 12, 2011 at 14:41
6

The tagprefix in your @register and the tag in in front of the scriptmanager must match. Also I think you better use the ToolkitScriptManager that comes with the toolkit http://blog.turlov.com/2008/05/scriptmanager-vs-toolkitscriptmanager.html:

In my case it is cc1:

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

and in your <body>

<cc1:ToolkitScriptManager ID="TKSM" EnablePageMethods="true" EnableCdn="true" ScriptMode="Release" runat="server">
</cc1:ToolkitScriptManager>
1
  • I dont have ToolkitScriptManager in my toolbox, why is that?
    – user222427
    Commented Nov 12, 2011 at 14:43
3

Add targetFramework="4.0" in the compilation tag in web.config file.

0

just Try this: Add this code in your web.config file

<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

OR

Rebuild your project

1
  • OR? Did you just suggest he rebuilds his solution to fix the problem?
    – Christian
    Commented May 13, 2020 at 5:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.