Home All Groups Group Topic Archive Search About

Viewstate and Master page with programmatically created content

Author
25 Jan 2006 6:41 PM
timpera2501
I am considering designing a page where all the controls on the page are
created programmatically.

I read the MSDN Library article at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskAddingControlsToWebFormsPageProgrammatically.asp

According to that article, as long as all the controls on the page are
created dynamically, there shouldn't be an issue with the Viewstate loosing
it's place and causing an error.

What I want to know, is if the dynamically created controls are inside a
ContentBlock that is inside a Master page, do the controls on the Master page
have to be created at run-time as well?  Or can they be created at design
time?  Will design time controls in the master page mess up the viewstate for
the run-time created controls in my ContentPlaceHolder?

Author
27 Jan 2006 11:37 PM
Phillip Williams
No.  They will not.
Show quoteHide quote
"timpera2501" wrote:

> I am considering designing a page where all the controls on the page are
> created programmatically.
>
> I read the MSDN Library article at
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskAddingControlsToWebFormsPageProgrammatically.asp
>
> According to that article, as long as all the controls on the page are
> created dynamically, there shouldn't be an issue with the Viewstate loosing
> it's place and causing an error.
>
> What I want to know, is if the dynamically created controls are inside a
> ContentBlock that is inside a Master page, do the controls on the Master page
> have to be created at run-time as well?  Or can they be created at design
> time?  Will design time controls in the master page mess up the viewstate for
> the run-time created controls in my ContentPlaceHolder?