c*o 发帖数: 70 | 1 .net doesn't support control array feature.
If I have ten TextBox controls laying out in a web form,I have to name them
differently rather than named them with a same name then differeniate them by
index. it is not convinient if I want to use a loop to get all the text value
of them in code. Any one has any idea or hint? | c*****o 发帖数: 34 | 2 create and manipulate them programmatically, i.e., in your code
【在 c*o 的大作中提到】 : .net doesn't support control array feature. : If I have ten TextBox controls laying out in a web form,I have to name them : differently rather than named them with a same name then differeniate them by : index. it is not convinient if I want to use a loop to get all the text value : of them in code. Any one has any idea or hint?
| c*o 发帖数: 70 | 3 I know how to do it programatically. But it is hard to put array of controls
in an existing table layout. I am thinking using the previous VB way, drag
and drop control arrays on to a form,and differentiate them by index. The
should be some reason why .net abandons this great feature.
them
by
value
【在 c*****o 的大作中提到】 : create and manipulate them programmatically, i.e., in your code
| C****n 发帖数: 2324 | 4 Control Array feature sucks. It's a foundmental design flaw and should be
discarded.
In .Net, you have better way to do it:
foreach (Control c in tablecell.Controls)
if (c is TextBox)
{
.............
}
If you want to manipulate them in javascript, I am not very familiar with
javascript, but there has to be a way to do it, javascript is soooooo
flexible.
them
【在 c*o 的大作中提到】 : I know how to do it programatically. But it is hard to put array of controls : in an existing table layout. I am thinking using the previous VB way, drag : and drop control arrays on to a form,and differentiate them by index. The : should be some reason why .net abandons this great feature. : : them : by : value
|
|