Using the Page Header Property

If you need to programmatically change the Title or CSS rules included in a Master Page, you can use the Page.Header property. This property returns an object that implements the IPageHeader interface. This interface has the following two properties:

• StyleSheet

• Title

For example, the content page in Listing 5.14 uses the SimpleMaster.master Master Page. It changes the Title and background color of the Master Page.

Listing 5.14. HeaderContent.aspx

images

images

The Page.Header property returns the server-side <head> tag contained ...

Get ASP.NET 4 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.