InterviewSolution
Saved Bookmarks
| 1. |
What is View State? |
|
Answer» ViewState is used to persist the data of page or page controls on postback. Viewstates are present on a page as a hidden field with data in an encrypted format. We can store any kind of data. Advantages:
Disadvantages:
Example: public class Person { public string FirstName {get;set;} public string LastName {get;set;} } public PARTIAL class default : Web.UI.Pages { Person p = new Person(); p.FirstName = "Harshit"; p.LastName = "Mittal"; ViewState["PersonDetails"]=p; } |
|