简体   繁体   中英

Create custom controls dynamically in ASP.NET

I want to create custom control (let's name it DesignPanel ) that will allow user to design his own webpage structure that would be stored in a sitemap file. This Design Panel will have child controls inside ( SiteElement ). User will build page strcture by connect Site Elements, customize them ( like change name) and add new ones .

This last point is main issue for me. Should I add those Site Element controls dynamically like DesignPanel.Controls.Add(new SiteElement()) in UpdatePanel control or there is better approach ( adding them to DOM structure by javascript, something diffrent)?

I dont need any code or prepared solution, just name techniques that I should look for!

thanks!

Sitemap can be dynamically created from database entries, that may be easier for you.

Server side option is better while dynamically generating forms, because problem with DOM approach is not recommended because of browser compability, manual handling of server side events and management of state etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM