Solved

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

Posted on 2009-05-13
1
793 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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

772 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

12 Experts available now in Live!

Get 1:1 Help Now