Set - 3

Question 1 :

What is Viewstate?

Answer :

A server control's view state is the accumulation of all its property values. In order to preserve these values across HTTP requests, ASP.NET server controls use this property, which is an instance of the StateBag class, to store the property values.


Question 2 :

Can any object be stored in a Viewstate?

Answer :

An object that either is serializable or has a TypeConverter defined for it can be persisted in ViewState


Question 3 :

What should you do to store an object in a Viewstate?

Answer :

Do serialization of convert the object to string


Question 4 :

Explain how Viewstate is being formed and how it's stored on client.

Answer :

The type of ViewState is System.Web.UI.StateBag, which is a dictionary that stores name/value pairs. ViewState is persisted to a string variable by the ASP.NET page framework and sent to the client and back as a hidden variable. Upon postback, the page framework parses the input string from the hidden variable and populates the ViewState property of each control. If a control uses ViewState for property data instead of a private field, that property automatically will be persisted across round trips to the client. (If a property is not persisted in ViewState, it is good practice to return its default value on postback.)


Question 5 :

What do you know about ADO.NET's objects and methods?

Answer :

ADO.NET provides consistent access to data sources such as Microsoft SQL Server, as well as data sources exposed through OLE DB and XML.
Data-sharing consumer applications can use ADO.NET to connect to these different data sources and retrieve, manipulate, and update data.
ADO.NET provides first-class support for the disconnected, n-tier programming environment for which many new applications are written.