![]() ![]() ![]() We examine how to programmatically set the page's title in Step 1. It is possible, then, to customize a content page's element by writing a bit of code in the page's Page_Load event handler. Using the Header property we can set an ASP.NET page's title or add additional markup to the rendered section. This class contains a Header property that provides access to the page's region. All ASP.NET pages derive from the Page class, which is located in the namespace. Notice that the element contains a runat="server" attribute, which indicates that it is a server control (rather than static HTML). The default master page file created by Visual Studio 2008 contains the following markup in its section: In this tutorial we examine how to define global and page-specific section markup in the master page and in its content pages. However, there are portions of the element that are page-specific. For example, you might want to globally import the same CSS rules and JavaScript files for every ASP.NET page. Some of this information may be pertinent to all pages in the website. This includes information such as the web page's title, meta-information used by search engines or internal crawlers, and links to external resources, such as RSS feeds, JavaScript, and CSS files. The HTML element serves as a repository for information about the web page document that is not part of the document itself. ![]() Our master page, Site.master, currently has four ContentPlaceHolder controls.) (Of course, these two ContentPlaceHolders can be modified or removed, and additional ContentPlaceHolder may be added to the master page. The head ContentPlaceHolder enables pages to add custom content to the section. The purpose of ContentPlaceHolder1 is to define a region in the Web Form that can be customized on a page-by-page basis. New master pages created in Visual Studio 2008 have, by default, two ContentPlaceHolder controls: one named head, and located in the element and one named ContentPlaceHolder1, placed within the Web Form. ![]() Looks at different techniques for defining assorted elements in the Master Page from the content page. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |