O'Reilly logo

Learning ASP.NET 2.0 with AJAX by Dan Hurwitz, Jesse Liberty, Brian MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Master Pages

Add a new page, Login.aspx. Check both checkboxes: "Place code in separate file" and "Select master page." When the Master Page dialog comes up, select MasterPage. master.

Add several other new pages: Home.aspx, Products.aspx, Cart.aspx, Purchase.aspx, and Confirm.aspx. For each of these, select the same master page. Set Home.aspx to be the startup page.

Open MasterPage.master. Add a style statement to the <head> element to import the style sheet, as in the highlighted line in the following snippet:

	<head runat="server">
	    <title>Untitled Page</title>
	     <style type="text/css">@import url(StyleSheet.css); </style>
	</head>

Add an HTML table for layout, inside the <div> element, but before the content placeholder control. You can use the IDE tools or just type it manually in the Source view window. With the help of Intellisense, I find it easier to type it manually.

Add the controls highlighted below:

	<table border="0">
	   <tr>
	        <td colspan="4">
	            <table>
	                <tr>
	                    <td width="10px">&nbsp;</td>
	                    <td>
	                        <asp:ImageButton ID="ibLogo" runat="server"
	                            ImageUrl="~/images/AdventureWorksLogo-250x70.gif"
	                            AlternateText="AdventureWorks logo"
	                            PostBackUrl="~/Home.aspx" />
	                    </td>
	                    <td width="10px">&nbsp;</td>
	                    <td width="500px" align="right">
	                        <span class="PageTitle">Adventure Works</span>
	                        <br />
	                        <asp:Label ID="lblPageSubTitle" runat="server"
	                            CssClass="PageSubTitle" Text="Page SubTitle"/>
	                        <br />
	                        <asp:Label id="lblTime" runat="server"
	                            CssClass="TextXSmall"/> </td> <td width="10px">&nbsp;</td> </tr> <tr> <td ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required