Skip to main content
 首页 » 编程设计

C# web 控件是否会在 visible 为 false 时显示

2024年02月03日28www_RR

如果 Web 用户控件的 visible 属性设置为 false,该控件是否仍会呈现?


感谢所有快速回复。我不希望控件在某些情况下呈现,所以这就是我一直在寻找的答案。

请您参考如下方法:

如果你的意思是Control.Visible属性,而不是你提到的属性,那么是的,它不会被渲染。

在上面的链接上:

Control.Visible Property gets or sets a value that indicates whether a server control is rendered as UI on the page.

If this property is false, the server control is not rendered. You should take this into account when organizing the layout of your page.