Explain View State? And its advantages and disadvantages.

Answer

Suppose a user submits a form and there are validation errors or if the page refreshes after the user enters a lot of information on the page. In such cases, the information already written by the user will be lost, and he/she has to fill everything again. To avoid this from happening, ASP.NET uses ViewState, which retains the values already entered by the user. It is a built-in state management technique to preserve the form data. 

Advantages:

  • Ensures security as data is stored in an encrypted format.
  • No server resources used.
  • ViewState properties can be easily enabled or disabled.
  • Developers can develop it at page level or control level as per need.

Disadvantages:

  • If a huge amount of data is stored, loading the page may take longer than required.
  • Data doesn't transfer from one page to another (between pages).

All .net-4.5 Questions

Ask your interview questions on net-4-5

Write Your comment or Questions if you want the answers on net-4-5 from net-4-5 Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---