Solved

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

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

816 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now