<%@ Register tagPrefix="myCtrls" tagName="header" Src="header.ascx" %>
<%@ Register tagPrefix="myCtrls" tagName="footer" Src="footer.ascx" %>
<html>
<head>
<title>ASP.NET Primer: User Control Syntax Example</title>
<link rel="stylesheet" href="/shared/netdemos.css">
<style type="text/css">
<!--
h3 {margin-bottom:0}
-->
</style>
</head>
<body style="margin:0">
<div align="center"><myCtrls:header runat="server" /></div>
<div style="margin: 5 20">
<div class="header"><h2>ASP.NET Primer: <span class="hilite">User Control Syntax Example</span></h2></div>
<p>This example shows how to insert a custom header and footer within an ASP.NET page.
<p>Both the header and footer in this page are stored as separate files with an <b>.ascx</b> filename extension, which can be easily inserted into any or all <b>.aspx</b> pages of a site via a simple <<code>tagPrefix:tagName runat="server"</code>> declaration.
<p align="center"><img src="/shared/images/pagelets2.gif" width=250 height=200 border=0 alt=""></p>
<p>User controls are best suited in scenarios where code is to be shared and re-used across multiple pages of an application. These include not only static code for headers, footers, and menus, but even code that dynamically generates content as well.
<p>To see how this sample is done, <a href="/shared/viewsrc.aspx?path=/aspnet/webforms/demos/intro/userctrlsyntax.aspx.src">view the source code</a> for this set of pages.
</div>
<div align="center"><myCtrls:footer runat="server" /></div>
</body>
</html>