What is view state?

Answer Posted / jeyaseelan

view state is nothing but store all the current page
informations and the control details when the page is
postback.all the control details and values to be stored in
hidden field.Those hidden fields are creating dynamically
depending upon the page placed controls.If you want to
fetch the values of the previous page control(ex:'Name' is
the previous page control Id)

Get the value of name from second page

sample code:

string get_Name=viewstate["Name"].Tostring();

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between a debug and release build?

595


why you wouldn't want to write into it even if you could

572


What are the collections you've used?

581


What do you mean by web service?

657


Explain why do we use msmq?

564






How many types of generations are there in a garbage collector?

523


What is machine.config in .net?

579


What is the need of OLE-automation?

643


Describe session handling in a webform, how does it work and what are the limitations?

579


What is multiThreading in .NET?

598


What are the important components of .net?

567


Write the .net syntax for 'for loop'?

577


What is assembly in .net?

614


I want to serialize instances of my class. Should I use xmlserializer, soapformatter or binaryformatter?

545


How many namespaces are in .net version 1.1?

613