ASP.NET Tutorial/Custom Controls/header

Материал из .Net Framework эксперт
Перейти к: навигация, поиск

header control

<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Register Src="Control.ascx" TagName="Header" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <uc1:Header id="Header1" runat="server">
        </uc1:Header></div>
        <br />
        [ Page Content ]
    </form>
</body>
</html>
File: Control.ascx
<%@ Control Language="C#" AutoEventWireup="true" %>
<table width="100%" border="0" bgcolor="blue">
    <tr>
        <td><font face="Verdana,Arial" size="6" color="yellow"><b>
            User Control Test Page</b></font>
        </td>
    </tr>
    <tr>
        <td align="right"><font size="3" color="white"><b>
            An Apress Creation ?2005</b></font>&nbsp;&nbsp;&nbsp;
        </td>
    </tr>
</table>