I have a page that has two groups of 12 identical controls that use the following naming convention
I need to loop through them, inserting their values into a database, when the user presses the submit button.
I'm trying to find a way to do it without hardcoding a reference to each control separately...
Something equivalent to
for i = 0 to 11
get value of ctrl1_i
get value of ctrl2_i
next
OR
for i = 0 to 11
get value of ctrl1(i)
get value of ctrl2(i)
next
Since ASP.Net doesn't have control arrays or dynamic variables, does anyone know a way to do this?
Thanks,
Judy
Code:
ctrl1_1, ctrl1_2, ctrl1_3, etc. and
ctrl2_1, ctrl2_2, ctrl2_3, etc.
I need to loop through them, inserting their values into a database, when the user presses the submit button.
I'm trying to find a way to do it without hardcoding a reference to each control separately...
Something equivalent to
for i = 0 to 11
get value of ctrl1_i
get value of ctrl2_i
next
OR
for i = 0 to 11
get value of ctrl1(i)
get value of ctrl2(i)
next
Since ASP.Net doesn't have control arrays or dynamic variables, does anyone know a way to do this?
Thanks,
Judy