Tuesday 4 November 2014

View State Interview Questions

What is View State in Asp.net?

View state is nothing but a method that the ASP.NET uses to preserve page and control values between post backs. When the HTML markup for the page is rendered, the current state of the page and values that must be retained during postback are serialized into base64-encoded strings. This information is then put into the view state hidden field.

View state is client-side or server side state management technique?

View state is client-side state management technique

what are the client-side state management technique supported by ASP.NET?

View state
Control state
Hidden fields
Cookies
Query strings

View state is used by Asp.net page automatically or we need to apply it manually?

View state is used automatically by the ASP.NET page framework to persist information that must be preserved between postbacks.


When you can use (take advantage of vs) view state? Or what you can do by use view state?

a) Keep values between postbacks without storing them in session state or in a user profile.
b) Store the values of page or control properties that you define.
c) Create a custom view state provider that lets you store view state information in a SQL Server database or in another data store.

What are the advantages of using view state?

No server resources are required: The view state is contained in a structure within the page code.
Simple implementation: View state does not require any custom programming to use. It is on by default to maintain state data on controls.
Enhanced security features: The values in view state are hashed, compressed, and encoded for Unicode implementations, which provides more security than using hidden fields.


What are the limitations of view state?

Limitations: 

Because view state is stored in the page, it results in a larger total page size.
ASP.NET uses view state only with page and control properties.
View state isn't a good place to store sensitive information that the client shouldn't be allowed to see.

0 comments:

Post a Comment