I have an ASP.NET page which 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 an abstract property to return the ScriptManager in order to enable the base page to use 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 parser error:
Parser Error Message: The base class includes the field 'scriptManager2', but its type (System.Web.UI.ScriptManager) is not compatible with the type of control (System.Web.UI.ScriptManager).
How can I solve this?
Update: The script manager part of the designer file is:
protected global::System.Web.UI.ScriptManager scriptManager;