C# 检查是否从jquery启用或禁用了Devexpress aspxhtmlControl
我有这个页面,它是一个设置页面,使用AspxHtmlEditor,可以根据从不同页面保存的一些配置启用或禁用它。所以我需要做的是检查htmleditor是否被禁用,如果是的话,在加载页面时禁用一些控件。为此,我使用JQuery。如果启用了编辑器,访问的方式是什么C# 检查是否从jquery启用或禁用了Devexpress aspxhtmlControl,c#,jquery,.net,devexpress,C#,Jquery,.net,Devexpress,我有这个页面,它是一个设置页面,使用AspxHtmlEditor,可以根据从不同页面保存的一些配置启用或禁用它。所以我需要做的是检查htmleditor是否被禁用,如果是的话,在加载页面时禁用一些控件。为此,我使用JQuery。如果启用了编辑器,访问的方式是什么 我尝试使用(“#myeditor”).is(“:disabled”)但它不起作用,因为它总是返回false 根据您对控件的命名方式,可以在Javascript中访问,如下所述:(向下滚动到“如何访问客户端上的扩展”) 然后,您应该能够使
我尝试使用
(“#myeditor”).is(“:disabled”)
但它不起作用,因为它总是返回false 根据您对控件的命名方式,可以在Javascript中访问,如下所述:(向下滚动到“如何访问客户端上的扩展”)
然后,您应该能够使用myeditor.clientEnabled,它将返回
true
或false
您需要设置ASPxHtmlEditor的ClientInstanceName属性,如下所示:
<dvx:ASPxHtmlEditor ID="myeditor" runat="server" ClientInstanceName="myeditor">
... the rest of customizations goes here ...
</dvx:ASPxHtmlEditor>
window.myeditor.SetEnabled(false);
要检查编辑器是否在客户端启用,您需要调用:
myeditor.GetEnabled();
此外,可以使用JS窗口全局变量引用具有已定义ClientInstanceName的DX控件,如下所示:
<dvx:ASPxHtmlEditor ID="myeditor" runat="server" ClientInstanceName="myeditor">
... the rest of customizations goes here ...
</dvx:ASPxHtmlEditor>
window.myeditor.SetEnabled(false);
或
嗯