答案:<html>
<script language="C#" runat=server>
void Page_Load(Object sender, EventArgs e) {
// Create and populate a multi-dimensional array
int [][] MyArray = new int[5][];
for (int i=0; i<5; i++) {
MyArray[i] = new int[6];
for (int x=0; x<6; x++) {
MyArray[i][x] = x+(6*i);
}
}
// Databind array to server controls
Outer.DataSource = MyArray;
Outer.DataBind();
}
</script>
<body>
<asp:datalist id="Outer" runat=server>
<template name="ItemTemplate">
Here is an array's values:
<asp:repeater datasource="<%#Container.DataItem%>" runat=server>
<template name="ItemTemplate">
<%# Container.DataItem %>
</template>
</asp:repeater>
</template>
</asp:datalist>
</body>
</html>
上一个:Visual Studio .NET Enterprise Architect 中基于 Visio 的数据库建模:第一部分/1
下一个:Visual Studio .NET Enterprise Architect 中基于 Visio 的数据库建模:第三部分