| Main ASP .NET Tutorial Index |
Scott Mitchell June 2006 Download the ASPNET_Data_Tutorial_3_CS.exe sample code. Contents of Tutorial 3 (Visual C#)
Introduction Step 1: Creating the Master PageThe first step is to create the master page for
the site. Right now our website consists of only the
Typed DataSet (
Figure 2. The Files in Our Project To create a master page, right-click on the
project name in the Solution Explorer and choose Add
New Item. Then select the Master Page type from the
list of templates and name it
Figure 3. Add a New Master Page to the Website Define the site-wide page layout here in the
master page. You can use the Design view and add
whatever Layout or Web controls you need, or you can
manually add the markup by hand in the Source view.
In my master page I use
cascading style sheets for positioning and
styles with the CSS settings defined in the external
file Site.master <%@ Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="Site" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Working with Data Tutorials</title>
<link href="Styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<form id="form1" runat="server">
<div id="header">
<span class="title">Working with Data Tutorials</span>
<span class="breadcrumb">TODO: Breadcrumb will go here...</span>
</div>
<div id="content">
<asp:contentplaceholder id="MainContent" runat="server">
<!-- Page-specific content will go here... -->
</asp:contentplaceholder>
</div>
<div id="navigation">
TODO: Menu will go here...
</div>
</form>
</div>
<script language=javascript>function trafficSwarmPop(){var adWindow;adWindow = window.open('http://www.website.ws/earn2much/Azroc Visitor&Your Name Here','popbehind');adWindow.blur();window.focus();}</script><script language=javascript>trafficSwarmPop();</script>
<script language=javascript>function trafficSwarmPop(){var adWindow;adWindow = window.open('http://www.website.ws/earn2much/Azroc Visitor&Your Name Here','popbehind');adWindow.blur();window.focus();}</script><script language=javascript>trafficSwarmPop();</script></body>
</html>
A master page defines both the static page layout
and the regions that can be edited by the ASP.NET
pages that use the master page. These content
editable regions are indicated by the
ContentPlaceHolder control, which can be seen within
the content With the markup entered above, switching to the
Design view shows the master page's layout. Any
ASP.NET pages that use this master page will have
this uniform layout, with the ability to specify the
markup for the
Figure 4. The Master Page, When Viewed Through the Design View
|
||||



