1. Tạo 1 tempate dạng Master Page và thiết kế nội dung:
<%@ 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>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table border="1">
<tr>
<td colspan="2">Đây là tiêu đề</td></tr>
<tr>
<td width="30%">Đây là bên trái</td>
<td>
<asp:contentplaceholder id="Content" runat="server"></asp:contentplaceholder></td></tr>
</table>
</div>
</form>
</body>
</html>
2. Tạo 1 trang Main.aspx với nội dung:
<%@ Page Language="C#" MasterPageFile="MasterPage.master" AutoEventWireup="true" CodeFile="Main.aspx.cs" Inherits="Main" %>
<asp:Content ID="ContentID" ContentPlaceHolderID="Content" Runat="Server">Đây là nội dung</asp:Content>
3. Chạy file main.aspx, kết qua màn hình sẽ như sau:
| Đây là tiêu đề |
| Đây là bên trái |
Đây là nội dung |
|