ivgoneriding
Member
- Joined
- Feb 4, 2011
- Messages
- 10
- Programming Experience
- Beginner
I have an aspx page with 5 DDLs on it, those DDLs are called for example DDL1 through to DDL5 and will all be bound to the same select statement (they are for 5 different contact fields)
I would like to be able to populate the boxes, either all together on page load or one after another so that when one is changed the next one populates - it doesn't matter to me which way I do it, but I don't want to have to repeat the blocks of code, just changing the number at the end of the DDL name each time.
Is there a piece of looping code that I can use, something along the lines of a for next loop or while loop that increments an integer and adds that to the rest of the name. I tried the following but got caught out trying to convert a string to the name of the DDL:
Thanks
I would like to be able to populate the boxes, either all together on page load or one after another so that when one is changed the next one populates - it doesn't matter to me which way I do it, but I don't want to have to repeat the blocks of code, just changing the number at the end of the DDL name each time.
Is there a piece of looping code that I can use, something along the lines of a for next loop or while loop that increments an integer and adds that to the rest of the name. I tried the following but got caught out trying to convert a string to the name of the DDL:
VB.NET:
For i = 1 To 5
Do While i <= 5
selectcontact = countcontact & i
cxbasecode.PopulateDDL(ssql, selectcontact)
i=i+i
Loop
Next