Solved

I need a page to reference a property on Site.Master

Posted on 2011-02-11
5
418 Views
Last Modified: 2012-05-11
In the code behind of Site.Master I created an object, and want certain properties of that object made visible to "child" pages which use that Site.Master file.

Can I do that?

Thanks,
newbieweb
0
Comment
Question by:newbieweb
  • 4
5 Comments
 
LVL 13

Accepted Solution

by:
devlab2012 earned 500 total points
ID: 34872392

create public properties and in the content page add MasterType directive like <@MasterType.........
0
 

Author Comment

by:newbieweb
ID: 34872535
Could you please include the entire line, including the sample page/object name? I don't really get it.

Thanks,
newbieweb
0
 

Author Comment

by:newbieweb
ID: 34872733
Would that definition be in place of MasterPageFile="~/Site.master" ?

It sounds like this would then be a strongly typed definition, compared to using a MasterPageFile.

True?
0
 

Author Comment

by:newbieweb
ID: 34872792
I added this line:

<%@ MasterType VirtualPath="~/Site1.Master" %>

to the page, but do not know how to reference the property on the Site object.

Could you tell me?
0
 

Author Closing Comment

by:newbieweb
ID: 34872863
Got it!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 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

21 Experts available now in Live!

Get 1:1 Help Now