0
我已經通過使用CKEditor的ASP.NET控件(v 3.6.4)嵌入了Ckeditor的* .ascx控件。我也從AjaxControolToolkit4.5的ModalPopup控件,連接到鏈接按鈕。點擊後,它會顯示帶有單選按鈕列表的面板,並通過邏輯後面的代碼填充。CKEditor使用AjaxControlToolkit的ModalPopup
我應該如何更改我的* .ascx控件以在工具欄中有一個CKEditor'a插件按鈕,觸發此ModalPopup?
代碼(不工作):
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CKEditorWithModalPopup.ascx.cs" Inherits="Controls_CKEditorWithModalPopup" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<script type="text/javascript">
$(function() {
var a = {
exec: function (editor) {
javascript: __doPostBack('ctl03$LinkButton1', '') // explicite id for test
}
},
b = 'modalPopup';
CKEDITOR.plugins.add(b, {
init: function (editor) {
editor.addCommand(b, a);
editor.ui.addButton("modalPopup", {
label: 'Modal Popup',
icon: "~/Images/modal_popup.png",
command: b
});
}
});
});
</script>
<CKEditor:CKEditorControl ID="CKEditor1" BasePath="~/ckeditor" Toolbar="Basic" runat="server" />
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender" runat="server" TargetControlID="LinkButton1"
PopupControlID="Panel1" BackgroundCssClass="modalBackground" OkControlID="OkButton"
CancelControlID="CancelButton" DropShadow="true" PopupDragHandleControlID="Panel3" />
<asp:LinkButton ID="LinkButton1" runat="server" Text="Click here to change the paragraph style" />
<asp:Panel ID="Panel1" runat="server" Style="display: none" CssClass="modalPopup">
<asp:Panel ID="Panel3" runat="server" Style="cursor: move; background-color: #DDDDDD;
border: solid 1px Gray; color: Black">
<div>
<p>
Choose the phrase to insert:</p>
</div>
</asp:Panel>
<asp:RadioButtonList ID="rbList" runat="server" />
<p style="text-align: center;">
<asp:Button ID="OkButton" runat="server" Text="OK" />
<asp:Button ID="CancelButton" runat="server" Text="Cancel" />
</p>
</asp:Panel>