What is the Use of Add method in ViewState?

 Posted by vishalneeraj-24503 on 12/25/2013 | Category: ASP.NET Interview questions | Views: 2926 | Points: 40

Add() method is used to add keys and values pairs in ViewState.

Actually it's an alternate way of assigning values to ViewState keys.

For Example:-

ViewState.Add("Name", "Vishal");

Here,Name is a Key and Vishal is its Value.
Viewstate is used at page-level only.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response