Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > access dynamically added controls

Reply
Thread Tools

access dynamically added controls

 
 
sivagururaja@gmail.com
Guest
Posts: n/a
 
      06-08-2007
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.

 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      06-13-2007
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/a.../02/71175.aspx there are
lots of alternatives


--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net


<> wrote in message
news: oups.com...
> 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.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data and controls from dynamically added controls is rmoved on Submit David Hubbard ASP .Net 2 01-17-2006 06:52 PM
Inserting Controls Dynamically - with Validators Also Added Dynamically Jeffrey Todd ASP .Net 1 06-02-2005 04:33 PM
existing controls overlaying dynamically added controls ENathan ASP .Net Web Controls 2 01-10-2005 10:34 PM
newbie: Dynamically added controls are lost after postback NotYetaNurd ASP .Net 1 11-07-2003 01:31 PM
Positioning Dynamically added controls Harry ASP .Net 1 06-25-2003 06:08 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57