A
Andy Fish
Hi,
I am trying to get to grips with dynamic controls and viewstate, but my
situaition is more complicated as I am actually using a web user control. I
thought if I can explain what I'm trying to achieve maybe someone can point
out the best way to approach it.
On the window is a list of items displayed through a repeater. The user can
click to edit a single item. this generates a postback which causes an edit
panel to be displayed in the middle of the list. The edit panel is a web
user control created with LoadControl() and it has text boxes and other
server controls on it, so it needs to (a) respond to postback events and (b)
have viewstate.
Two ideas I have had but not tried are (1) have a single control statically
placed on the page but somehow move it to the right place in PreRender; or
(2) declare an instance of the control in the <ItemTemplate> so there is one
for every item, but make them all invisible apart from the one the user is
actually editing. Is either of these workable/advisable or is there a better
solution?
TIA for any suggestions
Andy
I am trying to get to grips with dynamic controls and viewstate, but my
situaition is more complicated as I am actually using a web user control. I
thought if I can explain what I'm trying to achieve maybe someone can point
out the best way to approach it.
On the window is a list of items displayed through a repeater. The user can
click to edit a single item. this generates a postback which causes an edit
panel to be displayed in the middle of the list. The edit panel is a web
user control created with LoadControl() and it has text boxes and other
server controls on it, so it needs to (a) respond to postback events and (b)
have viewstate.
Two ideas I have had but not tried are (1) have a single control statically
placed on the page but somehow move it to the right place in PreRender; or
(2) declare an instance of the control in the <ItemTemplate> so there is one
for every item, but make them all invisible apart from the one the user is
actually editing. Is either of these workable/advisable or is there a better
solution?
TIA for any suggestions
Andy