access dynamically added controls

S

sivagururaja

Dear All,

Im using ASP.NET 2.0 with C#.
In my aspx page, i have one HTML Table.
Using the javascript i add the rows dynamically.

1.What my problem is how can i access those controls.
When i click the submit button, i lose all those rows that were
added dynamically.
How can i persist those rows and how can i access the controls.

2.Also 'm using many checkboxes in cell2 of each row.
I want to manipulate whether it's checked or not. So i count the
number of checkboxes and loop through all the controls,
so that i validate whether it's checked or not. How can i count the
controls. Is there any syntax in Javascript like this
Cell2.Controls.Count ?

Help me to over come this problem...
Thanks a lot.
Regards
Raja.
 
T

Teemu Keiski

You'd need to work the creation of the controls on the server-side (pass
information from client to server what to create). It can take some cycles,
and if you want it look like that to the user, you could just use ASP.NET
Ajax's UpdatePanel, this way you'd develop like for client-side but it looks
like as if it happens at the client.

JavaScript does have syntac for that. You'd iterate though form's elements
or childNodes of a given node or then like this:
http://geekswithblogs.net/mparsons/archive/2006/03/02/71175.aspx there are
lots of alternatives
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top