我有一個按鈕陣列添加到面板控制,並需要將它們重置爲其原始值,這是可能的務實?如何重置ASP .NET c#頁面上動態創建的控件的值?
protected void Page_Load(object sender, EventArgs e)
{
RenderTable();
}
private void RenderTable()
{
Button[] board = new Button[9];
for(int i =0; i <board.Length; i++)
{
board[i] = new Button();
board[i].Text = " ";
board[i].Width= board[i].Height = 50;
board[i].Click += PlayerClick;
board[i].ID = "pos" + i;
Panel1.Controls.Add(board[i]);
}
}