📄 multiarraylist.aspx
字号:
<%@ Page Language="C#" %>
<Script Runat="Server">
public class Product {
public string ProductName;
public decimal Price;
public Product(string ProductName, decimal Price) : base() {
this.ProductName = ProductName;
this.Price = Price;
}
}
void Page_Load(object sender, EventArgs e) {
ArrayList colArrayList;
colArrayList = new ArrayList();
colArrayList.Add( new Product( "eggs", 2.10m ) );
colArrayList.Add( new Product( "milk", 3.24m ) );
dlstDataList.DataSource = colArrayList;
dlstDataList.DataBind();
}
</Script>
<html>
<head><title>MultiArrayList.aspx</title></head>
<body>
<asp:DataList
ID="dlstDataList"
Runat="Server">
<itemTemplate>
<%# ((Product)Container.DataItem).ProductName %>
- <%# String.Format( "{0:c}", ((Product)Container.DataItem).Price ) %>
</itemTemplate>
</asp:DataList>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -