I was building a website using Visual Studio 2008 and everything would build fine. It also published with no problems, however I kept on getting errors when visiting some of the pages. I ended up finding the answer on an old message post that saved me a lot of headaches. The guy who posted it didn’t write English very well, so I’ll give a more detailed example and explain how the fix worked for me.

This may happen when you make a copy of a page and then leave the class the same as the page that you originally copied. Heres more detail:

The error message i was getting:

BC30456: ‘Title’ is not a member of ‘ASP…

BC30456: ‘InitializeCulture’ is not a member of ‘ASP…

This might occur if the “inherits” at the top of your ASPX page doesn’t match your codebehind class. so for instance, I had a page called TermsCodeLookup.aspx, and I needed to modify it a bit for someone, so instead of recreating it, I copied the codebehind to a new page using the name  TermsCodeLookupNew.aspx:

in my TermsCodeLookupNew.aspx page:

<%@ Page Language=”VB” MasterPageFile=”~/master1.master” AutoEventWireup=”false” CodeFile=”TermsCodeLookupNew.aspx.vb” Inherits=”MemberPages_AR_TermsCodeLookup” title=”Untitled Page” %>

and in my TermsCodeLookupNew.aspx.vb code I had:

Partial Class MemberPages_AR_TermsCodeLookup
Inherits System.Web.UI.Page

If you look at the code above in the aspx file, I still had inherits= pointing to the original termscodelookup.aspx page that i had created instead of the TermsCodeLookupNew.aspx page.   And in the codebehind .vb file the partial class was named after the old termscodelookup page instead of termscodelookupnew.

it was an easy fix by just modifying the two like so:

<%@ Page Language=”VB” MasterPageFile=”~/master1.master” AutoEventWireup=”false” CodeFile=”TermsCodeLookupNew.aspx.vb” Inherits=”MemberPages_AR_TermsCodeLookupNew” title=”Untitled Page” %>

Partial Class MemberPages_AR_TermsCodeLookupNew
Inherits System.Web.UI.Page

Hope this helps someone like it did for me.  I’ll give props to the original poster and website here.  another way to fix this is to uncheck the box “Allow this precompiled site to be updateable”

UPDATE: Another area where this can occur is when you get this error and everything looks correct  in your pages and the inherits matches the codebehind class.  The reason this may not work is that the class name may reside in another webpage that you may have copied, and forgot about or never used to begin with.  Just do a solution-wide search  in visual studio of the class name of the page that you are getting the error on. Chances are it will find it in some long-forgotten page, or maybe a copy you made of a page in which you wanted to keep the original just in case.

Partial Class MemberPages_AR_TermsCodeLookup
Inherits System.Web.UI.Page
Advertisements