多维数祖数据绑定!
<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> 上一篇:个性化查询(具有分类模糊查询、换页等功能) 下一篇:SUNWEN教程之----C#进阶5 更多相关文章
|
推荐文章
精彩文章
|