P
PZ
I'm trying to set up a strategy to develop a webpage based almost entirely on
dynamic controls. However, the first few tests revealed a problem for me.
I have in my Page_Load dynamically created a Panel, an ImageButton and a
TextBox. The button and the textbox are then assigned to the Panel.
I have assigned the ImageButton with a click event and it fires ok. I fill
in a value in the TextBox control and press the button. The page is reloaded
as it should and the textBox value is preserved. So far so good.
Here is the problem/question: How do I render new controls to the panel
based upon the value in the textbox? As I understand it, you need to always
load dynamic controls in the page_load event to be able to preserve the
values/statecontrol? So basically load different controls to the same panel,
based upon what's in the textbox.
Can it be done at all? if not, how should I perform this? Any
leads/ideas/simple code examples are most welcome.
TIA
dynamic controls. However, the first few tests revealed a problem for me.
I have in my Page_Load dynamically created a Panel, an ImageButton and a
TextBox. The button and the textbox are then assigned to the Panel.
I have assigned the ImageButton with a click event and it fires ok. I fill
in a value in the TextBox control and press the button. The page is reloaded
as it should and the textBox value is preserved. So far so good.
Here is the problem/question: How do I render new controls to the panel
based upon the value in the textbox? As I understand it, you need to always
load dynamic controls in the page_load event to be able to preserve the
values/statecontrol? So basically load different controls to the same panel,
based upon what's in the textbox.
Can it be done at all? if not, how should I perform this? Any
leads/ideas/simple code examples are most welcome.
TIA