The page configuration is wrong. There is no any difference from controls added in the code-behind during PageInit or in page markup if the code is correct. In this particular page, the ViewState is broken, because the controls are not added correctly.