HiddenFeilds are used to store small amout of data during the post backs.Hidden field stores a single variable in its value property and must be explicitly added it to the page.
Each control on a Web Forms page, including the page itself, has a ViewState property, it is a built-in struture for automatic retention of page and control state, which means you don’t need to do anything about getting back the data of controls after posting page to the server.
Unlike Hidden Field, the values in ViewState are invisible when ‘view source’, they are compressed and encoded.
Hidden Fields contain information that is not visible on the page but is posted to the server along with a page post back While View State is the mechanism that asp.net uses to maintain the state of controls across page post backs.
Hidden Fields are used for pages that post to themselves or to other pages while View State works only when a page posts back to itself.
Hidden Fields does not support for storing structured values while View State support for structured values.
No comments:
Post a Comment