简体   繁体   English

vb.net中vs2010的iFrame可见性

[英]iFrame visibility in vs2010 in vb.net

Is there any way to set the visibility of an iFrame dynamically? 有没有办法动态设置iFrame的可见性?

Tried researching on the web but couldnt find any. 尝试在网上研究,但无法找到任何。

You could add a runat="server" tag to the iframe: 您可以向iframe添加runat="server"标记:

<iframe src="..." id="myframe" runat="server"></iframe>

and then in your code behind you could access it my id and set properties: 然后在你的代码后面你可以访问它我的id和设置属性:

myframe.Visible = False

Note that by setting its Visible property to False the iframe will not be rendered at all in the output HTML. 请注意,通过将其Visible属性设置为False,输出HTML中根本不会呈现iframe。 If you wanted to hide the iframe on the client only you could manipulate its Attributes or Style properties. 如果您想在客户端上隐藏iframe,则只能操作其属性或样式属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM