Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / June 2007

Tip: Looking for answers? Try searching our database.

access dynamically added controls

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sivagururaja@gmail.com - 08 Jun 2007 06:33 GMT
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.
Teemu Keiski - 13 Jun 2007 18:04 GMT
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

Signature

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

> Dear All,
>
[quoted text clipped - 18 lines]
> Regards
> Raja.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.