Hi Mark,
Dynamically added controls don't have to be recreated before the point
where viewstate is loaded. For example, you could dynamically create some
control during Page_Load and they will still get state restored correctly.
The reason it may work is because the Controls.Add() method recursively
loads the parent's view state into its children, even though the load view
state stage has passed. (See
http://msdn2.microsoft.com/en-us/library/ms972976.aspx, section "View State
and Dynamically Added Controls")
I'm not sure about your exact requirement regarding dynamically added
TemplateField for GridView, therefore I cannot guarantee this will also
work in your case. I can depict more if you could some of your code.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.