Hi,
From your description, you have defined a certain XML template which
contains the info of how a webform page's layout(webcontrols on the page )
are included and positioned, and you're wondering how to correctly add
those configured controls dynamically onto the webform page, yes?
As for this question, this is a typical "programmatically creating and
adding web server controls onto page" problem. Generally we should take
care on the following things when adding dynamic controls onto page:
1. As for creating , it'll be better if we can create those dynamic
controls in Init event though Page_load is also ok. And the most important
thing is that we need to create the controls in every request (not only the
intial request like IsPostBack==true)
2. For postback event handler for dynamic created controls, we also need
to add them everytime the page is executed. Also, we need to put the event
handler registering code before the page's post back event happending
(generally in page_init or Page_Load is ok)
Anyway, if you're not very familiar with the ASP.NET's page processing
model(events and viewstate mechanism....), I suggest you have a look at the
following tech articles which may help us have a more detail idea on the
problems we may meet when creating dynamic webpage UI:
#Creating Dynamic Data Entry User Interfaces
http://msdn.microsoft.com/library/en...asp?frame=true
#Understanding ASP.NET View State
http://msdn.microsoft.com/library/en.../viewstate.asp
#HOW TO: Dynamically Create Controls in ASP.NET by Using Visual C# .NET
http://support.microsoft.com/default...b;en-us;317794
If there're any further problems, please feel free to post here. Thanks,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)