Solved

Getting master page 'base type' inheritance to work with code behind

Posted on 2009-05-13
1
798 Views
Last Modified: 2013-12-17
There is a sample of dynamic master pages here
http://msdn.microsoft.com/en-us/library/c8y19k6h.aspx
...go down to the section 'Attaching Master Pages Dynamically'...

I am able to copy and paste it here and get it working as stated.  I cannot get it to work if my Master pages have code behind files.  I get a 'Compilation Error' that there is a conflict between BaseMaster and what appears to be another server created master page.  I tried inheriting both BaseMaster and also System.Web.UI.MasterPage but both give the error.

So my question is how do I get it to work when the blue and green master pages have code behind files?
0
Comment
Question by:stee1hed
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
stee1hed earned 0 total points
ID: 24378195
I figured it out.

In the aspx files, change the 'Inherits' attribute to the code behind class (not the BaseMaster class), then in the code behind class have it inherit the BaseMaster class.

So when aspx uses a code behind file they are not really treated as the same file, or one entity, as I thought.  The aspx file refers to the code behind file which can inherit another class, etc.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question