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