Technical ViewState question

  • Thread starter trepac-news7385
  • Start date
T

trepac-news7385

Looong story, but here's the summary:

I'm dynamically generating a single TextBox control (always with the
same exact ID), but in a different location each time (there will be a
varying number of dynamically generated Labels before and after it).

As near as I can tell, when the control doesn't move it participates in
ViewState and it's data value persists between postbacks.

However, if it moves (there are more/fewer Labels before it than last
trip), it's data does not persist.

This surprises me. Although I don't understand ViewState on a deep
level, I thought data was persisted by the control's ID, not it's
relative position in the list of controls.


My questions:

Is ViewState data persisted by relative position, or by ID, or by some
other method?

Is it dangerous to be "moving" controls around like I am?

Is there a way to keep the data persistent (using ViewState) when the
control moves to a different location?
Thanks in advance for any help!

--Larry
 

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,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top