0

VS 2012 / .NET Framework 4.5

Upon attempt to implement advice from an old (circa 2006) article on Master Pages, I’m finding that my custom “BasePage” class will not inherit from System.Web.UI.Page (no intellisense is registering for System.Web.UI.Page...) even though my project still builds without issue...:

using System;
using System.Web.UI;
using System.Web.UI.TemplateControl;

namespace myProject.App_Code
{
    public abstract class BasePage : System.Web.UI.Page
    {

    }
}

As a relative .NET/OOP rookie, am I missing a step, or is this “BasePage” methodology obsolete? (notwithstanding the larger question of WebForms' status as a web dev platform) -- The only obvious thing I thought to check was whether System.Web.UI.Page was a sealed class - which wouldn’t make sense - and of course this is easily verified not to be the case when my actual .aspx.cs files show inheritance from System.Web.UI.Page.

So again, contrary to the formatting of the code in this post, my “System.Web.UI.Page” inheritance reference is plain manually-typed text and invokes no intellisense - what is possibly going on?

1 Answer 1

2

You may need to set the File Properties of the class file to "compile" (it seems to set "content" as default sometimes (always?)).

see: Visual Studio doc. / File Properties

Sign up to request clarification or add additional context in comments.

1 Comment

a belated thanks for the tip - I’ve since moved on to VS2015 Community, so this issue has resolved itself, but good to know about the ‘compile' File Properties setting

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.