Hello everyone,
Here is a simplified but representative extract of my pages structure.
I know that this must not be the right way to do, neither efficient nor clear, but don't really know how to do it cleanly...
What would be the best way to create and update dynamically created controls ?
Each time an event is fired in my page, the UpdatePage() method is called, which updates page's controls using the same functions used for the creation, which return some value depending on app or object current state.
public partial class MyPage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
CreateControls();
}
protected void CreateControls()
{
foreach (SomeEnum myEnum in someEnumList)
{
Button _myButton = new Button();
_myButton.ID = "_" + myEnum.ToString();
_myBu ...
Go to the complete details ...