我需要从ckeditor按钮到达我的codebehind点击事件。 我与此代码为我定制的CKEditor按钮尝试(函数(){用ckEditor工具栏按钮调用Asp.Net按钮点击事件
//Section 1 : Code to execute when the toolbar button is pressed
var a = {
exec: function (editor) {
var testObj = editor.parentNode;
var count = 1;
while (testObj.getAttribute('id') != "form1") {
testObj = testObj.parentNode;
}
testObj.getElementById('<%= btnUserControls.ClientID %>').click();
}
},
//Section 2 : Create the button and add the functionality to it
b='usercontrols';
CKEDITOR.plugins.add(b,{
init:function(editor){
editor.addCommand(b,a);
editor.ui.addButton('usercontrols', {
label:'User Controls',
icon: this.path + 'ascx.png',
command:b
});
}
});
})();
但是我觉得这个代码不能达到我的Asp.Net button.Where我错了?谢谢。
他们并没有解决我的problem.Also我想这代码'__doPostBack( '<%= btnUserControls.ClientID%>',加入 'onClick');' –
@BahadırYılmaz有你试着用'__doPostBack('<%= btnUserControls .UniqueID%>','');'(在我的回答中,这是一个明显的错误,我编辑过它)? – tpeczek