ViewStateMode property in Asp.Net 4.0

I haven't started learning Asp.Net 4.0 yet, but I read a little in ViewState, where there is a new ViewStateMode property. In earlier versions of Asp.Net, if the parent had the ViewState disabled, the child controls also disabled the ViewState, even if EnableViewState was set to true.

a) So, if I understand it correctly, then the C child control having the ViewStateMode property set to Enable causes C to keep its view state, even if the parent control is disabled?

b) Is there a reason why the ViewStateMode hasnt / property could not be implemented in earlier versions of Asp.Net?

thanks

+4
source share
2 answers

a) correct.

b) It could be, but it is not. And EnableViewState cannot be changed without breaking existing code.

+2
source

EnableViewState allows you to save view state. ViewStateMode sets whether to use it or not. By default, ViewStateMode is set to Inherit for each control.

A) Absolutely.

B) In preview versions If the parent view mode is disabled, the child view state is also disabled. Many users have required a new ViewStateMode for a child control that can overwrite Parent ViewStateMode. So you have it. Are there any reasons why there was no color but black and white TV in the 1920s?

0
source

Source: https://habr.com/ru/post/1307801/


All Articles