我在我的 test.aspx 页面上动态创建一个复选框表。表的维度(行数和列数)是通过查询数据库来确定的。
在 test.aspx 页面中,我执行以下操作:
<script language="C#" runat="server">
protected void Page_Load ( object src, EventArgs e ) {
//Query the database to get the data for rows and columns
CheckBox[] chkBox = new CheckBox[rows * columns]; //creates a collection of checkboxes
//Iterate over the query set in a double for loop to create dynamic checkboxes
}
</script>
现在我的行数=20,列数=10,但它可以增加(列更有可能)。
我使用 Firebug 中的 Net 选项卡来确定不同事件所花费的时间,发现 GetTest.aspx 花费了接近 4 分钟,这等待的时间太长了。
有没有办法减少页面加载时间?我创建动态复选框的方法是否正确?
提前致谢。
干杯