Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 431
  • Last Modified:

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

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
newbieweb
Asked:
newbieweb
  • 4
1 Solution
 
devlab2012Commented:

create public properties and in the content page add MasterType directive like <@MasterType.........
0
 
newbiewebSr. Software EngineerAuthor Commented:
Could you please include the entire line, including the sample page/object name? I don't really get it.

Thanks,
newbieweb
0
 
newbiewebSr. Software EngineerAuthor Commented:
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
 
newbiewebSr. Software EngineerAuthor Commented:
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
 
newbiewebSr. Software EngineerAuthor Commented:
Got it!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now