BasePage in APP_Code not being inherited properly

I have the following setup. I have a VB file in my App_Code folder that I want to act as a basepage for common behavior. I would like my my aspx.vb file to inherit this class but when I do this my aspx file calls asp:Content an unrecognized tag. What am I not doing or doing wrong?
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web
Imports DataAccess
Imports System.Configuration.ConfigurationManager
Imports Microsoft.VisualBasic

Namespace pageUtilities
    Public MustInherit Class BasePage
        Inherits System.Web.UI.Page

        Protected MustOverride ReadOnly Property pageName() As String
        Protected MustOverride Property contentControl() As Content

        Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
            loadPage()
        End Sub
        Protected Sub loadPage()
            Dim label As New Label

            'create error label
            label.ID = "lblErrorMessage"
            label.CssClass = "errorLabel"

            'add context to display page contents
            contentControl.Controls.Add(label)
            contentControl.Controls.Add(getTable(pageName))
        End Sub
    End Class



End Namespace

__________________________________________________________________

Class BEIndex
    Inherits pageUtilities.BasePage
    Protected Overrides ReadOnly Property pageName() As String
        Get
            Return "BEIndex.aspx"
        End Get
    End Property
    Protected Overrides Property contentControl() As Content
        Get
            Return cntMain
        End Get
        Set(ByVal value As Content)
            cntMain = value
        End Set
    End Property



End Class
__________________________________________________________________

<%@ Page  Language="VB" AutoEventWireup="false" CodeFile="BEIndex.aspx.vb" Inherits="BEIndex"%>
<asp:Content ID="cntMain" ContentPlaceHolderID="MainContent" Runat="Server"/>

Open in new window

rufassaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alfred A.Commented:
Hi,

The Inherits part of your page directive, there should be a project namespace in it.  

Inherits="NamespaceOfProject.BEIndex"

This might be the problem.
0
Alfred A.Commented:
Hi,

I did not noticed that you are using a web content form, you might have forgotten to put the MasterPageFile in the page directive.

<%@ Page  Language="VB" AutoEventWireup="false" MasterPageFile="~/Sample.Master"  CodeFile="BEIndex.aspx.vb" Inherits="BEIndex"%>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rufassaAuthor Commented:
That allowed the aspx file to use the asp:content but the aspx.VB file can not see it. At this part of the code:

        Get
            Return cntMain
        End Get
        Set(ByVal value As Content)
            cntMain = value
        End Set

The cntMain gets "Name 'cntMain' is not declared"
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.