Answered by:
ViewState in Asp.Net WebPage

Question
-
User1357974559 posted
hi friends,
We have the property EnableViewState in page directory.
What happens if the property is true then it will maintain the control data in viewstate,
when it false how the data will maintain between postbacks.
Sunday, August 2, 2015 12:06 PM
Answers
-
User281315223 posted
The ViewState essentially functions as a single element that will store all of the states of the controls in your page and when ASP.NET sees this element, it will know how to handle and populate all of the necessary elements and their states.
When this is disabled, the content of your ASPX page will function as a traditional HTML <form> element and only the values with the "name" attribute set on it will be posted to the server and accessible and a hidden field will be added to the page to indicate if a PostBack is being performed or not.
The View State Overview on MSDN provides a bit more detail on the topic.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Sunday, August 2, 2015 6:16 PM -
User1724605321 posted
Hi Rams,<!--?xml:namespace prefix = "o" ns = "urn:schemas-microsoft-com:office:office" /--><o:p></o:p>
What happens if the property is true then it will maintain the control data in viewstate,<o:p></o:p>When property is true ,viewstate will contain information about page and its controls. Its does not have any interaction with server. It stays along with the page in the Client Browser. it use Hidden field to store its information in a encoding format( Base64 Encoded string).<o:p></o:p>
Please refer to link below for more details about ViewState:<o:p></o:p>
http://www.codeproject.com/Articles/31344/Beginner-s-Guide-To-View-State<o:p></o:p>
when it false how the data will maintain between postbacks.<o:p></o:p>You could also use Session, application, cache to maintain data between postbacks .<o:p></o:p>
For more information ,please refer to link below:<o:p></o:p>
http://forums.asp.net/t/1702911.aspx<o:p></o:p>
Best Regards,<o:p></o:p>
Nan Yu<o:p></o:p>
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, August 3, 2015 9:58 PM
All replies
-
User281315223 posted
The ViewState essentially functions as a single element that will store all of the states of the controls in your page and when ASP.NET sees this element, it will know how to handle and populate all of the necessary elements and their states.
When this is disabled, the content of your ASPX page will function as a traditional HTML <form> element and only the values with the "name" attribute set on it will be posted to the server and accessible and a hidden field will be added to the page to indicate if a PostBack is being performed or not.
The View State Overview on MSDN provides a bit more detail on the topic.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Sunday, August 2, 2015 6:16 PM -
User-693045842 posted
Hi Rams,
Rams91
when it false how the data will maintain between postbacks.You could use cache to maintain data between postbacks :
https://msdn.microsoft.com/en-us/library/xsbfdd8c.aspx
lemo
Monday, August 3, 2015 9:56 PM -
User1724605321 posted
Hi Rams,<!--?xml:namespace prefix = "o" ns = "urn:schemas-microsoft-com:office:office" /--><o:p></o:p>
What happens if the property is true then it will maintain the control data in viewstate,<o:p></o:p>When property is true ,viewstate will contain information about page and its controls. Its does not have any interaction with server. It stays along with the page in the Client Browser. it use Hidden field to store its information in a encoding format( Base64 Encoded string).<o:p></o:p>
Please refer to link below for more details about ViewState:<o:p></o:p>
http://www.codeproject.com/Articles/31344/Beginner-s-Guide-To-View-State<o:p></o:p>
when it false how the data will maintain between postbacks.<o:p></o:p>You could also use Session, application, cache to maintain data between postbacks .<o:p></o:p>
For more information ,please refer to link below:<o:p></o:p>
http://forums.asp.net/t/1702911.aspx<o:p></o:p>
Best Regards,<o:p></o:p>
Nan Yu<o:p></o:p>
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, August 3, 2015 9:58 PM -
User-37275327 posted
If disabled,
Let say you have a drop down with selected item, on the page refresh, selection will be cleared.
Wednesday, August 5, 2015 10:37 AM