How should I use the Dispose method of Web server control?
How should I use the Dispose method of Web server control?
In page_load event, I remove Button1 from page.Controls, then call this Button's Dispose.
In run time, when I set the button's Backcolor, the Button's BackColor will be draw.
Code:
this.Controls.Remove(Button1);
Button1.Dispose();
Button1.BackColor=Color.Red;
Why? How should I use the Dispose method of Web server control?