New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Error - The type or namespace 'ScriptManager' does not exist in the namespace 'System.Web.UI'

Description

If you get a ScriptManager related error like follows, the tips below may help you to solve it:

Server Error: The type or namespace 'ScriptManager' does not exist in the namespace 'System.Web.UI' (are you missing an assembly reference?)

Solution

  1. Add a reference to the assembly System.Web.Extensions: Select Project-> Add Reference and then select the assembly name.

  2. Add the following Page directive to the aspx/ascx file:

     <%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web"%>
    
  3. Remove the ID attribute from the ScriptManager declaration (for example ID="ScriptManager1") in the aspx/ascx file and delete the protected global::System.Web.UI.ScriptManager ScriptManager1 declaration from the designer.cs file.

  4. Search in the designer for System.Web.UI.WebControls.ScriptManager and replace it with System.Web.UI.ScriptManager.

  5. Change the target Framework of your ASP.NET project to a different version and after that change it back to the original one.

  6. Try the suggestions in this MSDN blog post: Why did I receive the error: "The type or namespace '' does not exist in the class or namespace '' (are you missing an assembly reference?)"

  7. [ASP.NET MVC environment] If you use the Telerik UI for ASP.NET AJAX controls in ASP.NET MVC, please note that this is not supported as explained in the following article Telerik and ASP.NET MVC. The Telerik ASP.NET AJAX controls are based on the ASP.NET Web Forms paradigm and rely on the its server lifecycle that is not available in ASP.NET MVC. You can use the Telerik UI for ASP.NET MVC controls instead.

In this article
Not finding the help you need? Improve this article