Solved

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

Posted on 2009-05-13
1
796 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 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