How do i reset values of dynamically created controls on ASP .NET c# page?

Posted by Euclid on Stack Overflow See other posts from Stack Overflow or by Euclid
Published on 2010-06-02T16:33:12Z Indexed on 2010/06/02 16:44 UTC
Read the original article Hit count: 291

Filed under:
|

i have an array of buttons added to a panel control and need to reset them to their original values, is this possible pragmatically?

 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]);
    }
}

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET