Creating Master Pages with Visual Web Developer

We've just created our Master Page below which is given the default name 'MasterPage.master'. Notice that it's saved in the root directory of your website and has the file extension '.master'. Below is what the source code of our new page looks like. The important aspect of this code is the <asp:contentplaceholder> control. This designates the area where the Content Page that inherits the Master Page can insert its content.

Figure 6
Master Page

Figure 7 shows our Master Page in design view. You'll notice the 'Design' and 'Source' tabs at the bottom left which let you switch easily between both views.

You'll notice the ContentPlaceHolder 'ContentPlaceHolder1' which is the area that will house the unique content for the Content Pages.

Figure 7
Master Page

Now that we've created the Master Page we need a Content Page. Select 'File' and then 'New File'.

Figure 8
Master Page

Make sure you select 'Web Form' and that 'Visual Basic' is selected. We have given our page the name 'page1.aspx' and again as we are not using code-behind files we have left 'Place code in separate file' unchecked.

Figure 9
Master Page

Creating Master Pages with Visual Web Developer Part 3 >>

Creating Master Pages with Visual Web Developer Part 1 <<

Get the best asp hosting provider from web-hosting-top.com and save up to 30%

Advertisements



MembersPro

MembersPro PayPal - ASP Membership software

Plug and play ASP membership script that integrates with PayPal to let you charge recurring membership fees.

Global ASP.NET Hosting Leader - Click Here