EDIT: The main problem seemed to be that I was just doing "Add Existing Item" from an old web site project into an ASP.NET Web Application project. This caused so much trouble I just started from scratch, except that instead of adding existing items, I added new Master Pages and aspx pages to the project then populated them. The same problem persists.
I have a legacy project that is just a standard web site. I've started a new project as a web application and have transplanted in all the pages I need. However, I'm receiving 100+ errors that are comprised mostly of slightly different permutations of the following:
'System.Web.UI.MasterPage does not contain a definition for 'headerImage'
(I get this in code-behind)'MasterPage' does not contain a definition for 'imgHeader'
(also this is in code-behind)
Regarding the first error, it's as though the project is not comprehending that the master page is set. I set the master page at the top of each one of my aspx pages like:
<%@ page language="C#" masterpagefile="~/MasterPages/MasterPage.master" autoeventwireup="true" inherits="Equipment.aspx.cs" title="Untitled Page" %>
<%@ MasterType VirtualPath="~/MasterPages/MasterPage.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<!-- some content -->
</asp:Content>
Also, I clearly expose a headerImage
property in the ~/MasterPages/MasterPage.master code-behind:
public partial class MasterPage : System.Web.UI.MasterPage
{
#region Properties
private string _headerImage;
public string headerImage
{
get
{
return _headerImage;
}
set
{
_headerImage = (string)value;
}
}
// other stuff
}
And yet VS is still looking for this property in the System.Web.UI.MasterPage base class!
I've already checked out this post and it didn't solve my problem.
Thoughts? All feedback is appreciated. Thanks guys.