在代码后面检查以查看是否已将控件设置为显示:无? [英] Code-behind check to see if a control has been set to display: none?
本文介绍了在代码后面检查以查看是否已将控件设置为显示:无?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我目前有一个控件,正在使用 dropdown.hide();
.
I currently have a control that is being hidden on my server side using dropdown.hide();
.
hide()
是我创建的用于隐藏方法的服务器端方法,例如
hide()
is a server-side method I created to hide my methods, e.g.
control.Style["display"] = "none";
如何在服务器端知道我的控件是否隐藏?
How can I tell, on the server-side, if my control is hidden or not?
推荐答案
我猜你不是在说:
if (control.Style["display"] == "none") { .... }
您希望在回发后知道吗?如果真是这样,那么除非您使用JavaScript将事实隐藏在隐藏的输入或类似的内容中,否则您将无法做到这一点.
And that you want to know after a postback? If that's the case, then you can't do it, unless you store the fact it's hidden in a hidden input or something like that, using JavaScript.
这篇关于在代码后面检查以查看是否已将控件设置为显示:无?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文