I am getting an error after I have changed the code behind files for Master, default and login pages to use BasePage.
The compiler error message is
Make sure that the calls defined in this code file matches the 'inherits' attribute, and that it extends the correct base class.
The detail error is CS0030 - Cannot convert type 'ASP.masterpages_masterpage_master' to 'System.Web.UI.MasterPage'
I am also getting error code CS1061.
This is the master page code..
Code:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
public partial class MasterPage : BasePage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
This is the base page code
Code:
using System;
using System.Web;
public class BasePage : System.Web.UI.Page
{
private void Page_PreRender(object sender, EventArgs e)
{
if (this.Title == "Untitled Page")
{
throw new Exception("Page title cannot be \"Untitled Page\".");
}
}
public BasePage()
{
this.PreRender += new EventHandler(Page_PreRender);
}
}
Not sure what I did wrong as it looks the same as the sample code.
Thanks
Michael