tags:

views:

38

answers:

2

i created dynamically a table with in a function... this table is added to a panel. and this panel is in ajax updatepanel... statically i have given no of rows as 3, for that table... in page_load my table with 3 rows is created.... but i cannot identify this table in another button click event...

i wrote the code like this...

System.Web.UI.WebControls.Table table = (System.Web.UI.WebControls.Table)addrowpnl.FindControl("Table1");

here Table1 is my dynamic table id.....

could anyone please suggest me to solve this

A: 

This is the so known problem of dynamically created objects in ASP.NET.

Read this to get a grasp of what I'm telling you:

Accessing controls created dynamically (c#)

Leniel Macaferi
A: 

I had similar problem with dynamically created buttons. What you should try is to create objects in Page_Init rather then in Page_Load. I know it is not always possible but it should be done there.

Maciej