Thursday, September 27, 2012

Import URL for Interview Questions


http://faqsdotnet.blogspot.in

http://anumanj.blogspot.in/

http://royalarun.blogspot.in/



What is the difference between view state and a hidden field


hidden field :
The hidden field does not show, but still, when the form is submitted the hidden field is sent with it.Therefore the visitor can't type anything into a hidden field but we can assign values. getting values in post back or on page load.
View state:
To store values between postbacks in ASP.NET we go for viewstate ie
When a postback happens (i.e. when a form is submitted to a server), the variable values that are set in the code-behind page are erased from the memory of the client system. This concept would be different from what happens in Windows-based applications, where the variables persist in memory until they are freed from the memory either by the garbage collector, or by specific codes like dispose or finalize.
In web applications, variable values simply get erased. But it is very simple to persist these values. They may be persisted using the Viewstate object. Before the postback is invoked, the variable's value is saved in a viewstate object. In the same page, the viewstate's value may be retrieved back after hitting the server and returns back.

No comments:

Post a Comment