简体   繁体   中英

Copying the whole layout with controls from one aspx page to another page - Moving Controls dynamically - ASP.Net

Here is my issue.

I've a page main.aspx. This page has a button 'Settings'. When it is clicked, I load another aspx page settigns.aspx in a popup. Now in the settings.aspx i allow the users to add controls dynamically. For example the user can create 5 textboxes. When he saves it there, I need to get that controls to main.aspx.

So i need to move all the controls from one page to another page. I'm not able to think of a solution with user controls.

Any ideas on this?

To communicate between pages, you would have to store the collection of controls in Session, Cache, or something else so that the other page could use it. That's probably not going to be viable. What you need to do is recreate the UI on the other page. So give the page the number of textboxes and values, and have that second page recreate it.

Putting this building logic in a user control would help tremendously, or figure out a way to keep them on the same page to leverage both features.

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