Wrox Programmer Forums
|
BOOK: Professional ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Professional ASP.NET 4.5 in C# and VB by Jason N. Gaylord, Christian Wenz, Pranav Rastogi, Todd Miranda, Scott Hanselman; ISBN: 978-1-1183-1182-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 4.5 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 16th, 2013, 11:06 AM
Authorized User
 
Join Date: Jun 2013
Posts: 36
Thanks: 1
Thanked 4 Times in 4 Posts
Default Public properties with nested master pages

If I have "OuterMasterPage" that contains "InnerMasterPage" that contains "ContentPage", how can I get to public properties of the "OuterMasterPage" & "InnerMasterPage" from my "ContentPage"?

ContenPage has <%@ MasterType VirtualPath="~/InnerMasterPage.master" and can use Master.InnerMasterProperty syntax

I have added to InnerMasterPage <%@ MasterType VirtualPath="~/OuterMasterPage.master", but public properties of the OuterMasterPage are not available in the ContentPage;

Two <%@ MasterType directives in the ContentPage are not allowed

Is there a reasonable solution to this?

PS: I had a similar question on MCTS exam

Last edited by Oleg Kolpashchikov; July 30th, 2013 at 04:04 AM..
 
Old July 17th, 2013, 04:28 PM
Authorized User
 
Join Date: Jun 2013
Posts: 36
Thanks: 1
Thanked 4 Times in 4 Posts
Default Solution from 2004 still works

Found a solution on forum.asp.net

ContentPage needs <%@ Reference VirtualPath="~/OuterMaster.master" %> and now properties of the OuterMaster are available.
I tested it, of course, and it works.
 
Old July 26th, 2013, 12:55 AM
Authorized User
 
Join Date: Jun 2013
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That is bit tricky i guess..
__________________
REI Coupon
 
Old July 30th, 2013, 04:09 PM
jason.gaylord's Avatar
Wrox Author
 
Join Date: Mar 2013
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I'm glad you have solved this issue. Please let us know if you still have issues.
__________________
Jason Gaylord
http://jasongaylord.com
@jgaylord





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Nested master pages SouthendSupporter ASP.NET 3.5 Basics 1 March 3rd, 2011 10:15 AM
General question - Master Pages, Base pages, templates and OOP. flapjack BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 May 1st, 2010 09:33 AM
Problem in nested master pages. harsh.kintu ASP.NET 2.0 Professional 2 January 9th, 2007 10:04 AM
strange "errors" with nested master pages... thenoseknows ASP.NET 2.0 Professional 2 November 28th, 2006 05:28 PM
Public properties becoming obsolete BenCh BOOK: ASP.NET Website Programming Problem-Design-Solution 1 July 17th, 2005 08:29 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.