.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 31st, 2003, 03:08 AM
melblue melblue is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 1 melblue User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
textbox looping

i have an aspx page with 30 textboxes
the naming convention i used is Textbox1.....TextBox30
i used this convention because i have function(page behind) in which all the values of the Textboxes are assigned into an arraylist.
Instead of writing
arraylist(0)=Textbox1.Text
arraylist(1)=Textbox2.Text
is there any better way in which i could add a loop so that all values will be assigned into the arraylist

Reply With Quote
  #2  
Old January 7th, 2004, 04:10 PM
mikanu mikanu is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Rosemont, IL, USA
Posts: 14 mikanu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 34 sec
Reputation Power: 0
Send a message via Yahoo to mikanu
I'd say that the best way to go about your problem would be to create the textboxes dynamically at run time and make them as components of an array... That would save you a lot of time.

you would have to first declare the array of textboxes as new textboxes and then add them to your form with the AddControl method. I'm not sure that it would work in ASPX but it sure does in Windows apps so... why not give it a try

For more info try MSDN. Do a search for "Creating controls dynamically" or somethin' similar

Good luck

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > textbox looping


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT