面板可见=真不起作用

编程入门 行业动态 更新时间:2024-10-20 13:52:25
本文介绍了面板可见=真不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个小组,我设置可见=真实明确。调试器越过这条线和可见仍计算为False下一行。显然,作为一个结果,小组不显示。这怎么可能?

I have a Panel that I'm setting visible=true explicitly. The debugger passes over that line and visible still evaluates to False on the next line. Obviously as a result, the Panel is not shown. How is this possible?

pnlValidate.Visible = true; if (IsPostBack) return; <asp:Panel ID="pnlValidate" runat="server"> <asp:Button cssclass="submit2" ID="btnValidate" runat="server" Visible="false" text="Validate" OnClick="btnValidate_Click" /> <br /> <asp:TextBox ID="txt6sql" runat="server" Visible="false" TextMode="multiLine" Width="500" Height="200" ReadOnly="true" ToolTip="Report SQL Statement" /> </asp:Panel>

ASP.NET 2.0,没有其他的线程或靠不住erratta认为应该与我的会员搞乱。

ASP.NET 2.0, no other threads or wonky erratta that "should" be messing with my members.

推荐答案

嵌套在另一个面板或任何其他类型的容器已可见设置为false内部的面板?

Is your panel nested inside another panel or any other type of container which has Visible set to false?

对于这样的情况下你所观察到的行为是可再现。这将是有意义禁止能见度设置为true内部容器如果外部容器是看不见的,因为这意味着里面什么也没有必须是可见的,甚至没有内板的空div。

For such a situation the behaviour your observed is reproducable. It would make sense to forbid to set visibility to true for the inner container if an outer container is invisible since that means nothing inside must be visible, even not the empty div of the inner panel.

Visible属性似乎是依赖于外容器的知名度,如:

The Visible property seems to be dependent on the visibility of outer containers, for instance:

<asp:Panel ID="Panel0" runat="server" Visible="false"> <asp:Panel ID="Panel1" runat="server" Visible="false"> Content... </asp:Panel> </asp:Panel>

这code是如预期(使外容器中可见,再内胆):

This code is as expected (make outer container visible first, then inner container):

Panel0.Visible = true; // Now Panel0.Visible returns true and Panel1.Visible returns false Panel1.Visible = true; // Now Panel0.Visible returns true and Panel1.Visible returns true

这code是有点令人惊讶(使内胆可见光第一,那么外部容器):

This code is somewhat surprising (make inner container visible first, then outer container):

Panel1.Visible = true; // Now Panel1.Visible returns false (!, your issue) and Panel0.Visible returns false Panel0.Visible = true; // Now Panel1.Visible returns true (!!) and Panel0.Visible returns true

似乎设置和获取Visible属性是非对称:二传手似乎放置标志的控制,但消气返回一个计算值依赖于外部因素的知名度和能见度控制自己。

It seems that setting and getting the Visible property is "asymmetric": The Setter seems to place a flag in the control, but the Getter to return a calculated value which depends on the visibility of the outer elements and the visibility of the control itself.

不知道这是否会帮助你的。

Not sure if this will help you at all.

更多推荐

面板可见=真不起作用

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

发布评论

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

>www.elefans.com

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