Tuesday, October 13, 2009

Chapter 5-Lesson 1

  • Masterpages derive from Masterpage and have a @Master directive.
  • ContentPlaceholder can also be placed in the head section.
  • asp:Content tag defines the substitution content for a ContentPlaceholder in Page that derives from a Masterpage.
  • Everything (except the Page directive) inside an ASPX page that derives from a Masterpage should be enclosed within a Content control.
  • Settings on the masterpage usually take priority over settings made on content pages.
  • Masterpages may be applied at individual page level, folder level or entire web application level. This is done respectively using @Page directive or pages section in web.config file.
  • Content pages can reference/access public properties defined in the Masterpage class.
  • @MasterType directive should be defined in the content page where masterpage properties need to be accessed. This enables the use of Master class to access Masterpage's public properties.
  • We may reference Masterpage controls from within content pages using Master.FindControl( ) method.
  • Events first get fired for Masterpage and then for content page.
  • Masterpages can be nested into one another.
  • Page.MasterPageFile property may be used to switch masterpages programatically. We only need to make sure all the different masterpages provide exactly same number and names of content placeholders to ensure compatibility.

No comments:

Post a Comment