alt
Advertisement
Sponsored links
Online Training
Career Series
Exforsys
Exforsys arrow Tutorials arrow ASP.NET 2.0 arrow ASP.NET 2.0 Tutorials : Creating Content for Master Page
Site Search


ASP.NET 2.0 Tutorials : Creating Content for Master Page
Article Index
ASP.NET 2.0 Tutorials : Creating Content for Master Page
Page 2

ASP.NET 2.0 Tutorials : Creating Content for Master Page

In this tutorial you will learn how to create contents for a Master Page, create a home page, add contents to home page and finally test the home page.

 

Creating Content for the Master Page

The template for the content is now ready. We shall proceed to define content for the master page by creating an ASP.NET page that is attached to the Master Page. Content pages are specialized forms of .aspx pages that only contain the content. Content can be text or controls. We shall create a content page for the Home page and another for the About page.

To create the home page

1. In Solution Explorer, right-click the name of the Web site, and click Add New Item.

2. Under Visual Studio installed templates, click Web Form.

3. In the Name box, type Home.

4. In Language, click the programming language C#.

5. Select the Select Master Page box, and then click Add.

6. The Select a Master Page dialog box appears.

7. Click MasterPage.master, and then click OK.

Content pages do not have the usual html elements such as < html >, < body > etc. It contains only the content that has to be displayed on the master page by replacing the placeholder for content.

To add content to the home page

1. Switch to Design view.

The content control is displayed as a ContentPlaceHolder control in the master page. The rest of the Master page will appear dimmed because other parts cannot be modified while editing content.

2. In the Properties window, from the drop-down list, click DOCUMENT, and then set Title to ExForSys Home Page.

The title of each content page can be set independently for correct display of title when the page is displayed on the browser. The title information gets stored in the content page’s @Page directive.

3. Right-click the title bar of the Content control, and then click Create Custom Content.

4. In the Content control, type Welcome to the ExForSys Web Site, select the text, and then format the text as a Heading 1.



 
< Prev   Next >
Exforsys Offers
© 2008 Exforsys.com
Joomla! is Free Software released under the GNU/GPL License.
Page copy protected against web site content infringement by Copyscape