一、
二、引用用户控件:
例子:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register TagPrefix="ShopControls1" TagName="head" Src="~/userControls/head.ascx"%>
<!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>首页</title>
</head>
<body>
<form id="form1" runat="server">
<table border="1" style="border-color: #43a0db;">
<tr>
<td colspan="2">
<table style="width: 447px">
<tr>
<td style="width: 656px">
<ShopControls1:head ID="head1" runat="server"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
如上: 注册
<%@ Register TagPrefix="ShopControls1" TagName="head" Src="~/userControls/head.ascx"%>
使用
<ShopControls1:head ID="head1" runat="server"/>
格式: <TagPrefix:TagName ID="" />