what is view state and its use

Answers were Sorted based on User's Feedback



what is view state and its use..

Answer / nageswara rao.g

viewstate is just like hidden field.Basically all html
controls are stateless .if u want maintain state for page
level we can use viewstate.

Is This Answer Correct ?    25 Yes 4 No

what is view state and its use..

Answer / chinnu

view state that automatically preserves property values of
the page and all the controls on it between round trips.

Is This Answer Correct ?    22 Yes 7 No

what is view state and its use..

Answer / rajesh

Actully All HTML controls are state-less ie;-these can not
store any type of clients inputs.when ever we send the page
to server it will send this page as fresh one.so we loose
the data what we have entered.

To store all these data (temporarly) in clients browsers ,
.Net provide a concept that is known as View state .View
state store the data in encoding format,so that one can not
gues it easily.

Is This Answer Correct ?    22 Yes 7 No

what is view state and its use..

Answer / namrata

In simple words........
(1)if you are not using viewstate: When a form is submitted
in ASP,all form values are cleared(get lost). For
example,If you submit a web form with lots of details and
the server comes back with an error.You will have to go
back to the form and correct the detail. Then You click the
back button to that same form, you will find that all form
values are CLEARED and you will have to start all over
again!
(2)if you are using viewstate: When a form is submitted in
ASP .NET, the form reappears in the browser window together
with all form values. This is because ASP .NET maintains
your ViewState. The ViewState indicates the status of the
page with all the values of controls on it when submitted
to the server.

Is This Answer Correct ?    13 Yes 3 No

what is view state and its use..

Answer / vijay

view state is used to find the current state of an object,
forexample with the help of view state we can find that
whether is a button is click or not;

Is This Answer Correct ?    17 Yes 10 No

what is view state and its use..

Answer / guest

View state .. the web is stateless when it is loaded.. so.
in view state . we can view in which suivation..

Is This Answer Correct ?    7 Yes 2 No

what is view state and its use..

Answer / rashmi thakur

ViewState is a built-in structure for automatically
retaining values among multiple requests for the same page.
The view state is internally maintained as a hidden field
on the page but is hashed, providing greater security than
developer-implemented hidden fields do.
Following are the benefits of using ViewState:-
 No server resources are required because state is
contained in a structure in the page code.
 Simplicity.
 States are retained automatically.
 The values in view state are hashed, compressed,
and encoded, thus representing a higher state of security
than hidden fields.
 ViewState is good for caching data in Web farm
configurations because the data is cached on the client.
Following are limitation of using ViewState:-
 Page loading and posting performance decreases when
large values are stored because
 View state is stored in the page.
 Although view state stores data in a hashed format,
it can still be tampered with because it is stored in a
hidden field on the page. The information in the hidden
field can also be seen if the page output source is viewed
directly, creating a potential security risk.
 If page get destroyed or refresh information which
is stored in view state gets vanished.

Below is sample of storing values in view state.
this.ViewState["EnterTime"] = DateTime.Now.ToString();

Is This Answer Correct ?    11 Yes 7 No

what is view state and its use..

Answer / karvendhan

view state that automatically preserves property values of
the page and all the controls on it between round trips.

Is This Answer Correct ?    8 Yes 6 No

what is view state and its use..

Answer / om nama shiva ya namaha

when ever any server control can raise its event then
browser can send its request to server and at the server
side the event executes and the response comes back to
browser is known as postback mechanism .During this postback
mechanism all the server controls data are stored in viewstate.
but for some controls like textbox,dropdown list,radiobutton
list etc can implement IPOSTBACK DATA HANDLERS interface for
this controls even if we put enableviewstate to false.these
controls can store all the data in html bodys .Even if we
disable viewstate they maintain data in the controls

Is This Answer Correct ?    7 Yes 5 No

what is view state and its use..

Answer / vaithianathan

hi, rajesh..
i am learning asp.net... actually, i dont know whether ur answer is correct or not.. but ur explanation is simply superb and easy to understand..

Is This Answer Correct ?    4 Yes 2 No

Post New Answer

More ASP.NET Interview Questions

Explain what are delegates?

0 Answers  


Difference between Htttppost and Httpget Methods?

3 Answers   Infosys, Microsoft,


Is asp.net 64-bit enabled? How?

0 Answers  


What Name space does the web page belon in the .net framework class hierarchy?

1 Answers   L&T, Wipro,


What command line used to generate Runtime callable wrapper.

2 Answers   CTS,






You create an ASP.NET application for a hotel. The application contains a page that displays current weather conditions for the city in which the hotel is located. The application calls an XML Web service every 10 minutes to update the current weather conditions. A new page is then displayed for subsequent requests. You want the same page to be cached and retrieved from the cache during the time between calls to the XML Web service. You decide to use a Page directive to accomplish this goal. Which Page directive should you use? A . <%@ Cache Seconds="600 '' VaryByParam="Page" %> B . <%@ OutputCache Time="600" %> C . <%@ OutputCache Duration="600" VaryByParam="None" %> D . <%@ OutputCache Duration="600" %>

2 Answers   Syntax Softtech,


What is mvc in asp.net interview question? : Asp.Net MVC

0 Answers  


What is asp net objects?

0 Answers  


explain ado.net

6 Answers  


Diff between web user control and web custom control?

0 Answers  


What is a nested masterpage in asp.net 2.0? Can there be a master page inside a masterpage?

0 Answers  


What are tuples?

0 Answers  


Categories