Click here to Skip to main content
15,063,944 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how does the textbox control retains it's value on postback even when the view state mode for the control is disabled.if the view state mode property for the control does not have any effect on the textbox control whether enabled or disabled then why this property is available for the control.
Posted
Updated 10-Jul-13 16:14pm
v2

Is EnableViewState true?

Quote:
The ViewStateMode property of a page or a control has an effect only if the EnableViewState property is set to true. If the EnableViewState property is set to false, view state will be turned off even if the ViewStateMode property is set to Enabled.
   
Comments
rtz87 10-Jul-13 22:44pm
   
i did set the EnableViewState property for the textbox control to false but the textbox control still retains it's values.
Its the matter of two events LoadPostData and LoadViewState.LoadPostData is called after LoadViewState.So irrelative to whether the viewstate is on or off,data gets populated into control at LoadPostData event.Refer to this article.It will definitely help you.

Why textbox persists data during postback even if View State set to off[^]

Regards.. :laugh:
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900