|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > .Net Development > textbox looping |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|