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

How we handle the runtime database schema change issue in asp.net application?

2 Answers   IBM, Tech Mahindra,


How do we implement bundling in MVC?

0 Answers   B-Ways TecnoSoft,


Dataset is the disconnected environment. suppose if you are binding records to gridview (disconnected environment) and you are making changes to the the grid but before updating the database if any other user modify the data, how will you avoid such problem?

0 Answers   Infosys, Hexaware,


1. What is Connection Pooling…? 2. Maintaining Sessions in ASP.NET 3. ASP.NET page lifecycle. 4. Can we store objects in sessions. 5. What is AJAX..? 6. Serialization/Deserialization. Why we use serialization and Deserialization…? 7. What are Arrays and Arraylist..? 8. Difference between Authentication and Authorization…? 9. Difference between abstract class and Interfaces 10. What is a view..? Does a view contain data..? 11. What are triggers..? 12. What are transactions..? 13. What is Metaview (oracle)..? 14. What is Inheritance..? How can we call a method from the base class..? 15. Can an abstract class have zero abstract methods..? 16. How to read from Message Queue..? 17. What is Metadata..? 18. You would prefer to have business logic in c# or DB Side..? Why…?

1 Answers   Franklin Templeton, Sky InfoTech,


why should i use FormsAuthentication.RedirectFromLoginPage (); Method in Form Authentication?Without using this method also it's good??

2 Answers  






what is asp and asp.net ?

2 Answers   Inspira Technologies,


define silverlight and advantages ?

3 Answers   QA,


What is validationsummary server control? where it is used ?

1 Answers  


What is a PostBack ?

1 Answers  


How To Generate ConnectionString By Using Notepad??

2 Answers  


How to disable cut, copy and paste in TextBox using jQuery in asp.net?

0 Answers   HCL,


How Web Service help? What is the difference between Remoting & Web Servcies?

2 Answers  






Categories