surya prakash
What is the concept of Master pages in ASP.NET2.0?Explain?
By surya prakash in ASP.NET on Jun 21 2007
  • Debabrata Ghosh
    Jun, 2007 22

    Master Pages was introduced in ASP.NET 2.0. A master page can serve as templete for other pages like a base class which can be inherited by derived classes and use the functionalities defined in the master pages. This makes life a lot more easier in making uniform pages across the site.

    The other web forms need to contain the contents unique to itself. A master page is similar to any ASPX file. Some differences are: (1) a master page has a .master file extension instead of a .aspx extension (2) uses an @ Master directive instead of an @ Page directive at the top. (3) You can have one or more ContentPlaceHolder controls for the ASPX pages to place their contents. Some of the similarities are: (1) Master pages also follow the page life cycle (2) Can have client-scripts as well as code-behind file associated with it.

    To associate an ASPX page to a master page, you may use the following: <% Page MasterPageFile="master page name" ...%> of the ASPX page. Once a master page is associated with an ASPX page, contents may be placed only inside the ContentPlaceHolder area, otherwise an error is reported.

    Thanks.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS