Parser error when using ScriptManager

I have an ASP.NET page that has a script manager on it.

<form id="form1" runat="server">
    <div>
        <asp:ScriptManager EnablePageMethods="true" ID="scriptManager2" runat="server">
        </asp:ScriptManager>
    </div>
</form>

The page overrides the abstract property to return the ScriptManager so that this base page uses it:

public partial class ReportWebForm : ReportPageBase
{
    protected override ScriptManager ScriptManager
    {
        get { return scriptManager2; }
    }

    ...
}

And the base page:

public abstract class ReportPageBase : Page
{
    protected abstract ScriptManager ScriptManager { get; }

    ...
}

When I run the project, I get the following analyzer error:

Parser error message: The base class includes the "scriptManager2" field, but its type (System.Web.UI.ScriptManager) is not compatible with the type of the control (System.Web.UI.ScriptManager).

How can i solve this?

Update: The administrative part of the constructor script file:

protected global::System.Web.UI.ScriptManager scriptManager;
+3
source share
2 answers

, , , .

EDIT: , , , - . System.Web.Extensions ? ( 3.5.0.0 .net 3.5 1.0.6xxx 2.0)

+5

, System.Web.Extensions(v3.5.sth) ​​web.config(v.1.0.6sth). dll (3.5) System.Web.Extensions .

+1

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


All Articles