<%@ Page Language="C#" AutoEventWireup="True" %>
<Script language="C#" runat="server">
void Page_Load(Object Sender,EventArgs e){
ArrayList array=new ArrayList();
array.Add("1234");
array.Add("5678");
array.Add("9101");
DataList.DataSource=array;
DataList.DataBind();
}
</Script>
<asp:datalist ID="DataList" runat="server">
<!--页头数据梆定-->
<headertemplate>
<div>
Some of the latest wrox Press Books
</div>
</headertemplate>
<!--页内容数据梆定-->
<itemtemplate>
<asp:label ID="Label_1" Text="<%#Container.DataItem%>" runat="server"></asp:label>
</itemtemplate>
<!--页尾数据梆定-->
<footertemplate>
<table>
<tr>
<td bgcolor="#0099CC">xfzf</td>
</tr>
</table>
</footertemplate>
</asp:datalist>
<Script language="C#" runat="server">
void Page_Load(Object Sender,EventArgs e){
ArrayList array=new ArrayList();
array.Add("1234");
array.Add("5678");
array.Add("9101");
DataList.DataSource=array;
DataList.DataBind();
}
</Script>
<asp:datalist ID="DataList" runat="server">
<!--页头数据梆定-->
<headertemplate>
<div>
Some of the latest wrox Press Books
</div>
</headertemplate>
<!--页内容数据梆定-->
<itemtemplate>
<asp:label ID="Label_1" Text="<%#Container.DataItem%>" runat="server"></asp:label>
</itemtemplate>
<!--页尾数据梆定-->
<footertemplate>
<table>
<tr>
<td bgcolor="#0099CC">xfzf</td>
</tr>
</table>
</footertemplate>
</asp:datalist>
博客展示了一段ASP.NET代码,使用C#语言在服务器端运行。代码创建了一个ArrayList并添加数据,将其作为数据源绑定到DataList控件,同时设置了页头、页内容和页尾的数据绑定,实现了数据的展示。
164

被折叠的 条评论
为什么被折叠?



