如何启用另一个类中的按钮. [英] How to enable a button from another class.
本文介绍了如何启用另一个类中的按钮.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在页面加载中禁用了一个按钮,该按钮在.aspx.cs视图中显示.现在,我必须访问控件类中的按钮,以便在某些条件匹配时可以启用按钮.如何从这里访问.如果我需要代码,可以使用findcontrol()方法完成这项工作.如果没有,则没有其他方法.
I disabled a button in page load which is hapening in the view .aspx.cs . I now have to access the button in the control class so that i can enable the button back when some condition matches . how to access from here. Can a findcontrol() method can do the job if so i need the code please. if not is there any other way to do it.
推荐答案
如果要禁用代码隐藏按钮,则也可以启用它.除非您想在客户端上执行此操作,否则可以使用JavaScript(我建议使用JQuery).
If you are disabling the button from your code-behind then you can also enable it. Unless you want to do it on the client, in which case you can use JavaScript (I would recommend using JQuery).
这篇关于如何启用另一个类中的按钮.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文