Solved

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

Posted on 2011-02-11
5
420 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

3 Use Cases for Connected Systems

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

Question has a verified solution.

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

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

770 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