Click here to Skip to main content
16,016,306 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hay to all, :)
i am using following code.
On my page ,there are "count" number of user controls ,which are generating at run time.
MIDL
for (int i = 0; i < count; i++)
                {

Control MyCustomControl = LoadControl("DynamicData/FieldTemplates/ColumnDetails.ascx");
Controls.Add(MyCustomControl);   PlaceHolderUserControl.Controls.Add(MyCustomControl);
     
                }

Now I want to get data from all of these user controls.
Posted
Updated 29-Nov-10 9:36am
v3

1 solution

You may want to keep a list of the ClientIds of the controls you are adding to your Controls Collection. You can even use something as simple as a List of strings to achieve this. When you want information from them, you can do a Controls.FindControl( <savedclientid> ) to retrieve them and then process whatever you want from them.
 
Share this answer
 
v3
Comments
M_AhsanRiaz 29-Nov-10 15:48pm    
Actually,usercontrol has some textboxes,same userControl is adding multiple times on my page and i do not know their count.I want to get data from all of these.
Dalek Dave 29-Nov-10 17:38pm    
Good Call.

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