Page.Controls - 缺少控件? [英] Page.Controls - controls are missing?
本文介绍了Page.Controls - 缺少控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在GridLayout中创建了一个带有一些Web控件的ASP.NET页面(test.aspx)
(设计时间)。 />
当我查看收集page.controls时
foreach(在Page.Controls中控制ctrl)
{
....
}
然后我看不到页面上的所有控件。
是否有一个特殊的控件集合用于设计时间gridlayout
控件?
祝你好运
弗兰克
(新手)
Hi,
I created an ASP.NET page (test.aspx) with some web controls in GridLayout
(Design time).
When I look at the collection page.controls by
foreach (Control ctrl in Page.Controls)
{
....
}
then I can not see all the controls on the page.
Is there a special controls collection for the design time gridlayout
controls?
Best regards
Frank
(newbie)
推荐答案
弗兰克,
每个Control系列只包含直接的孩子。
Eliyahu
Frank Esser <弥***** @ nurfuerspam.de>在消息中写道
新闻:%2 *************** @ TK2MSFTNGP12.phx.gbl ...
Frank,
Every Control collection contains only immediate children.
Eliyahu
"Frank Esser" <Mi*****@nurfuerspam.de> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
我在GridLayout中创建了一个带有一些Web控件的ASP.NET页面(test.aspx)(设计时间)。
当我查看集合页面时。由foreach控制(在Page.Controls中控制ctrl)
{
....
}
然后我看不到页面上的所有控件。
是否有一个特殊的控件集合用于设计时间gridlayout
控件?
最好的问候
Frank
(新手)
Hi,
I created an ASP.NET page (test.aspx) with some web controls in GridLayout
(Design time).
When I look at the collection page.controls by
foreach (Control ctrl in Page.Controls)
{
....
}
then I can not see all the controls on the page.
Is there a special controls collection for the design time gridlayout
controls?
Best regards
Frank
(newbie)
Hallo Eliyahu,
感谢您的回答。
如何迭代在设计时创建的控件?
例如,当我想让所有可用的控件不可见或禁用时
在运行时?
目前我必须直接通过名字给他们打电话。这对我的
编码非常难看......
谢谢
Frank
" Eliyahu Goldin <再************* @ monarchmed.com> schrieb im Newsbeitrag
新闻:uH **************** @ TK2MSFTNGP12.phx.gbl ...
Hallo Eliyahu ,
thanks for your answer.
How can I iterate through the controls that were created at design time?
For example when I want to make all available controls invisible or disabled
at runtime?
At the moment I have to call them directly by name. This is very ugly for my
coding...
Thanks
Frank
"Eliyahu Goldin" <re*************@monarchmed.com> schrieb im Newsbeitrag
news:uH****************@TK2MSFTNGP12.phx.gbl...
Frank,<每个Control系列只包含直接的孩子。
Eliyahu
Frank Esser <弥***** @ nurfuerspam.de>在消息中写道
新闻:%2 *************** @ TK2MSFTNGP12.phx.gbl ...
Frank,
Every Control collection contains only immediate children.
Eliyahu
"Frank Esser" <Mi*****@nurfuerspam.de> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
<我在
GridLayout
(设计时)创建了一个带有一些Web控件的ASP.NET页面(test.aspx)。
当我查看集合页面时。由foreach控制(在Page.Controls中控制ctrl)
{
....
}
然后我看不到页面上的所有控件。
是否有一个特殊的控件集合用于设计时间gridlayout
控件?
最好的问候
Frank
(新手)
Hi,
I created an ASP.NET page (test.aspx) with some web controls in
GridLayout
(Design time).
When I look at the collection page.controls by
foreach (Control ctrl in Page.Controls)
{
....
}
then I can not see all the controls on the page.
Is there a special controls collection for the design time gridlayout
controls?
Best regards
Frank
(newbie)
我必须承认在类似的情况下我操作控件
单独
。只是添加一些额外的代码行通常比花费数小时寻找更优雅的解决方案更好。
。如果你不想要
这个,你可以导航控件集合或尝试找到一种
容器元素(一个面板?),当它会禁用它的子节点时这是
残疾人士。
Eliyahu
Frank Esser <弥***** @ nurfuerspam.de>在留言中写道
news:%2 **************** @ TK2MSFTNGP14.phx.gbl ...
I must confess that in similar situations I do operate on controls
individually. Just to add a few extra lines of code is often a better idea
than spending hours on looking for more elegant solutions. If you don''t want
this, you can either navigate Controls collections or try find a sort of
container element (a panel?) that would disable its children when it is
disabled.
Eliyahu
"Frank Esser" <Mi*****@nurfuerspam.de> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hallo Eliyahu ,谢谢你的回答。
如何迭代在设计时创建的控件?
例如,当我想要制作所有可用的控件时隐形或
在运行时被禁用?
目前我必须直接通过名字来调用它们。这是非常丑陋的
我的编码......
Frank
" Eliyahu Goldin" <再************* @ monarchmed.com> schrieb im Newsbeitrag
新闻:uH **************** @ TK2MSFTNGP12.phx.gbl ...
Hallo Eliyahu ,
thanks for your answer.
How can I iterate through the controls that were created at design time?
For example when I want to make all available controls invisible or disabled at runtime?
At the moment I have to call them directly by name. This is very ugly for my coding...
Thanks
Frank
"Eliyahu Goldin" <re*************@monarchmed.com> schrieb im Newsbeitrag
news:uH****************@TK2MSFTNGP12.phx.gbl...
Frank,
<每个Control系列只包含直接的孩子。
Eliyahu
Frank Esser <弥***** @ nurfuerspam.de>在消息中写道
新闻:%2 *************** @ TK2MSFTNGP12.phx.gbl ...
Frank,
Every Control collection contains only immediate children.
Eliyahu
"Frank Esser" <Mi*****@nurfuerspam.de> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
<我在
GridLayout
(设计时)创建了一个带有一些Web控件的ASP.NET页面(test.aspx)。
当我查看集合页面时。由foreach控制(在Page.Controls中控制ctrl)
{
....
}
然后我看不到页面上的所有控件。
是否有一个特殊的控件集合用于设计时间gridlayout
控件?
最好的问候
Frank
(新手)
Hi,
I created an ASP.NET page (test.aspx) with some web controls in
GridLayout
(Design time).
When I look at the collection page.controls by
foreach (Control ctrl in Page.Controls)
{
....
}
then I can not see all the controls on the page.
Is there a special controls collection for the design time gridlayout
controls?
Best regards
Frank
(newbie)
这篇关于Page.Controls - 缺少控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文