Page.Controls

编程入门 行业动态 更新时间:2024-10-20 13:47:26
本文介绍了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> 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> 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> 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> 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

本文发布于:2023-11-06 13:49:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1563867.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Page   Controls

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!