Solved

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

Posted on 2011-02-11
5
424 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
[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
  • 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
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…

726 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