3、引用页面:
page_Ascx.aspx:
<%@ Page language="c#" Codebehind="page_Ascx.aspx.cs" AutoEventWireup="false" Inherits="firstcs_03.page_Ascx" %>
<%@ Register TagPrefix="uc1" TagName="moonPage" Src="moonPage.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>page_Ascx</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<link href="css.css" _fcksavedurl=""css.css"" _fcksavedurl=""css.css"" _fcksavedurl=""css.css"" rel="stylesheet" type="text/css">
</HEAD>
<body>
<form id="PageForm" method="post" runat="server">
<asp:DataGrid id="DataGrid1" runat="server" AllowCustomPaging="True" AllowPaging="True">
<PagerStyle Visible="False"></PagerStyle>
</asp:DataGrid><FONT face="宋体"><BR>
</FONT>
<asp:Repeater id="Repeater1" runat="server">
<HeaderTemplate>
Repeater控件的标头模版<br>
</HeaderTemplate>
<ItemTemplate>
名称:<%# DataBinder.Eval(Container.DataItem,"ProductName") %><br>
单价:<%# DataBinder.Eval(Container.DataItem,"UnitPrice") %><br>
</ItemTemplate>
<AlternatingItemTemplate>
名称:<font color="red"><%# DataBinder.Eval(Container.DataItem,"ProductName") %></font><br>
单价:<font color="red"><%# DataBinder.Eval(Container.DataItem,"UnitPrice") %></font><br>
</AlternatingItemTemplate>
<SeparatorTemplate>
<hr>
</SeparatorTemplate>
<FooterTemplate>
Repeater控件的页脚模版
</FooterTemplate>
</asp:Repeater>
<asp:Panel id="Panel1" runat="server" Width="634px">
<uc1:moonPage id="pc" runat="server"></uc1:moonPage>
</asp:Panel><FONT face="宋体"></FONT>
</form>
</body>
</HTML>
|