I have done this before by storing the data from the controls in session.
Every time you dynamically add a control, store the current data entered into the controls in session or viewstate for example, and then rebind on postback. Not the most elegant solution but it worked. I take it this is a webforms question?
- Add dynamic control click
- Save current form data
- On page_load load the data from viewstate into the controls
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…