View Single Post
  #2 (permalink)  
Old February 16th, 2006, 02:41 PM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Aaron,

You can make the control publicly available through a property. The following snippet exposes a <div> tag called Footer defined in the markup as a public property:

 public HtmlGenericControl PageFooter
 {
    get
    {
      return Footer;
    }
 }

You may be tempted to access that property like this in the code behind of a content page:

this.Master.PageFooter.Visible = false;

While this is indeed the code you need, you need something else to make this work. You need to add a MasterType directive to the markup part of the page:

<%@ MasterType VirtualPath="~/MasterPages/MasterPage.master" %>

Instead of VirtualPath, you can also use the TypeName property, but not both.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote