dynamic web user control and viewstate

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
 
R

Robert Koritnik

Well it's a better way to use dynamic creation. Eather with LoadControl or
new class instance creation...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top