Difference between PostData and ViewState in a custom control?

  • Thread starter Thread starter Henri
  • Start date Start date
H

Henri

Could you give an example that shows when to use PostData, and when to use
ViewState in a custom control.
Both permit to keep traces of user's actions between posts...
Thanks
 
Hi,

If I get you right ViewState holds the state of controls and PostData
the data that user sends from the client (via form). Controls such as
grid maintain lot of state (cells data) between postback but those
controls may or may not Post data. Other controls (textbox) Post data
but don't maintain any internal state between posts.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
 
Back
Top