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

What are the different authentication modes in the .NET environment?

2 Answers   Veritas,


What methods are fired during the page load?

2 Answers  


What is Fragment Caching in ASP.NET?

2 Answers   Wipro, pspl,


if i have placed the button control with the OnClick event like <asp:Button ID="mybutton" runat="server" Text="Insert" onclick="mybutton_Click" /> and some other controls(buttons, textboxes) in .aspx page. When i run the page, the button displays in the page source of the browser like <input type="submit" name="mybutton" value="Insert" id="mybutton" /> here, it does not display the onclick event, then how the page calls the button click on the server side, how the server side identify which button cause the submit, and how this page moves to the server side.

1 Answers  


Life cycle of ASP.NET page when a request is made ?

4 Answers   MMTS,






how can i am search the data from database? just like google

2 Answers  


What is the difference between Server.Transfer and Response.Redirect? Why would you choose one over the other?

26 Answers   Syntax Softtech,


What base class do all Web Forms inherit from?

8 Answers  


What is deference between asp.net, vb.net, c# & j#

2 Answers  


what is view stat how it is use ?

2 Answers   Amazon,


What is the roll of JIT in asp.net?

7 Answers  


How do you do exception management?

1 Answers   Accenture,






Categories