Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

On button Click. I am adding treeview controls in a placeholder based on the selection of the checkboxes.
On save click after selection i am unable to find the controls in the place holder
Find the code

C#
 foreach (Control ctrl in treeViewPlaceHolder.Controls)
                    {
}
Posted
Comments
syed shanu 30-Sep-14 1:13am    
I think its due to page refresh, check your dynamic controls are public
On Post Back those controls are lost. You have to add them again.
VC.J 7-Oct-14 7:30am    
because of the PostBack you lost dynamically added control , solution is that you need to add the control again.
[no name] 8-Oct-14 0:58am    
Hi see my answer, please accept the answer if it helps you.

1 solution

Read the answer of mokeefe in the below link. I hope that is your requirement.

http://forums.asp.net/t/1098870.aspx?Dynamic+Controls+in+Placeholder+lossed+after+postback[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900