Difference between PostData and ViewState in a custom control?

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
 
N

Natty Gur

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
 

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

Staff online

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top