avatar
control array in .net# DotNet - 窗口里的风景
c*o
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?
avatar
c*o
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?

avatar
c*o
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
avatar
C*n
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

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。