Here is Default.aspx
Here is Default2.aspx
The master page is a template. It can help provide a consistent look and feel for the web site. It also provides a single place where layout changes can be made that will cascade through the whole web site.
Here is the html and ASP code for the Master page and the two Content pages and the stylesheet--such as it is.. I am not posting the class or the code behind. I will add them when they become relevant.
MasterPage.master
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!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>Magazine Subscriptions</title>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<h1>Magnificent Magazines</h1>
<p> <a href="Default.aspx">Order Form</a>|<a href="Default2.aspx">Confirmation</a></p>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
Here is the simple style sheet
Stylesheet.css
body {
}
h1
{
background-color:Navy;
color:White;
border:2px solid black;
text-align:center;
}
h2
{
color:Navy;
}
Content pages have no html. They just have two content areas. One is for header content such as a script element for javascript, or meta elements
Default.aspx
<%@ Page Title="Order" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<h2>Magazine Order From</h2>
<p>
<asp:Label ID="Label1" runat="server" Text="Enter Your first Name"></asp:Label>
<asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox><br />
<asp:Label ID="Label2" runat="server" Text="Enter Your Last Name"></asp:Label>
<asp:TextBox ID="txtLastName" runat="server"></asp:TextBox><br />
<asp:Label ID="Label3" runat="server" Text="Enter Your first Street"></asp:Label>
<asp:TextBox ID="TxtStreet" runat="server"></asp:TextBox><br />
<asp:Label ID="Label4" runat="server" Text="Enter Your first City"></asp:Label>
<asp:TextBox ID="txtCity" runat="server"></asp:TextBox><br />
<asp:Button ID="Button1" runat="server" Text="Submit" />
</p>
</asp:Content>
Default2.aspx
<%@ Page Title="Confirmation" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<h2>Confirm Order</h2>
<p>
<asp:Label ID="Label1" runat="server" Text="Enter Your first Name"></asp:Label>
<asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox><br />
<asp:Label ID="Label2" runat="server" Text="Enter Your Last Name"></asp:Label>
<asp:TextBox ID="txtLastName" runat="server"></asp:TextBox><br />
<asp:Label ID="Label3" runat="server" Text="Enter Your first Street"></asp:Label>
<asp:TextBox ID="TxtStreet" runat="server"></asp:TextBox><br />
<asp:Label ID="Label4" runat="server" Text="Enter Your first City"></asp:Label>
<asp:TextBox ID="txtCity" runat="server"></asp:TextBox><br />
<asp:Button ID="Button1" runat="server" Text="Submit" />
</p>
</asp:Content>
No comments:
Post a Comment