检查c#后面的div代码的可见性 [英] check visiblity of div code behind c#

查看:115
本文介绍了检查c#后面的div代码的可见性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在方法后面检查div是否可见。如果div可见,我必须插入数据,否则我不必插入任何数据。

解决方案

确保div上有一个id和一个runat =server,然后你可以在代码隐藏中访问它。



< pre lang =xml> < div id = div1 < span class =code-attribute> runat = server >
...
< / div >





  if (div1.Visi ble)
{
// 做任何事
}


I want to check div is visible or not in code behind method.If div will be visible, i have to insert data otherwise i don't have to insert any data.

解决方案

Make sure you're div has an id and a runat="server" on it and then you can access it in codebehind.

<div id="div1" runat="server"> 
... 
</div>



if (div1.Visible)
{
 // do whatever
}


这篇关于检查c#后面的div代码的可见性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆