Wednesday, April 20, 2011

Referencing Custom Master Page Properties From Content Pages

To reference master page properties from content pages
  • Create a public property in the master page code-behind file
  • Add the @ MasterType declaration to the ASPX content page
    <%@ MasterType VirtualPath="~/Site.master" %>
  • Reference the master page property from content page as
    Master.[property_name]