Can I make viewstate enabled for controls where Enableviewstate of the container page is set to false?

 Posted by Bhakti on 12/17/2009 | Category: ASP.NET Interview questions | Views: 3013

You can set it to true or false as per your requirement but in fact it will not have any effect to the controls. Because viewstate in ASP.NET has hierarchical nature. Hence, following code will not work if you have set EnableViewState = false; for page.
protected void Page_Load(object sender, EventArgs e)

txtTest.EnableViewState = true;

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response