我有兩個控件。
Button1和button2。按鈕1工作正常。按鈕2確實稱它爲服務器端事件,但是當發生這種情況時,我們得到一個CKEditor的dissasembly。
我有一個包含CKEditor和一個asp按鈕的jQuery UI對話框。點擊此按鈕時,服務器端的所有值都將丟失,並顯示反彙編。
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="ckeditor/custom/dialog-patch.js"></script>
<span style="width: 500px; height: 100%">
<CKEditor:CkEditorControl id="CKEditor1" runat="server" AutoPostBack="false">
</CKEditor:CkEditorControl>
</span>
定義
$(function() {
// to load editor
CKEDITOR.on('dialogDefinition', function(ev) {
// Take the dialog name and its definition from the event
// data.
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
// Check if the definition is from the dialog we're
// interested on (the "Link" dialog).
if (dialogName == 'link') {
// remove contents
dialogDefinition.removeContents('target');
dialogDefinition.removeContents('upload');
dialogDefinition.removeContents('advanced');
// Get a reference to the "Link Info" tab.
var infoTab = dialogDefinition.getContents('info');
// Remove the "Link Type" combo and the "Browser
// Server" button from the "info" tab.
infoTab.remove('linkType');
infoTab.remove('browse');
}
else if (dialogName == 'table') {
// Get a reference to the default tab.
var infoTab = dialogDefinition.getContents('info');
infoTab.remove('selHeaders');
infoTab.remove('txtHeight');
infoTab.remove('txtCellSpace');
infoTab.remove('txtCellPad');
infoTab.remove('txtCaption');
infoTab.remove('txtSummary');
infoTab.remove('cmbAlign');
}
});
});
功能打開包含CKEditor的對話框。
function EditDialog(element,supplier,codeId,name, category,categoryCode, noteId,templateText) {
var numberOfNotes = $(element).parent().children('.text').length;
var noteBody = "";
if (numberOfNotes == 1) {
noteBody = $(element).parent().children('.text').html();
}
if (noteBody == "") {
noteBody = templateText;
}
$('#<%=esupplier.ClientID %>').val(supplier);
$('#<%=ename.ClientID %>').val(name);
$('#<%=enotecategory.ClientID %>').val(category);
$('#<%=hfCategoryCode.ClientID %>').val(categoryCode);
$('#<%=hfNoteID.ClientID %>').val(noteId);
$('#<%=hfIdCode.ClientID %>').val(codeId);
var dialogeditcontainer = $('#editdialog').dialog('open');
dialogeditcontainer.parent().appendTo(jQuery('form:first'));
CKEDITOR.instances[$('#editorName').val()].setData(noteBody);
return false;
}
定義
$(function() {
// to load editor
CKEDITOR.on('dialogDefinition', function(ev) {
// Take the dialog name and its definition from the event
// data.
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
// Check if the definition is from the dialog we're
// interested on (the "Link" dialog).
if (dialogName == 'link') {
// remove contents
dialogDefinition.removeContents('target');
dialogDefinition.removeContents('upload');
dialogDefinition.removeContents('advanced');
// Get a reference to the "Link Info" tab.
var infoTab = dialogDefinition.getContents('info');
// Remove the "Link Type" combo and the "Browser
// Server" button from the "info" tab.
infoTab.remove('linkType');
infoTab.remove('browse');
}
else if (dialogName == 'table') {
// Get a reference to the default tab.
var infoTab = dialogDefinition.getContents('info');
infoTab.remove('selHeaders');
infoTab.remove('txtHeight');
infoTab.remove('txtCellSpace');
infoTab.remove('txtCellPad');
infoTab.remove('txtCaption');
infoTab.remove('txtSummary');
infoTab.remove('cmbAlign');
}
});
});
最後兩個ASPX按鈕。第一個工作,第二個不工作。第二個按鈕位於與ckeditor的對話框中。
這是一個作品。
<asp:Button id="A2" runat="server" onclick="btnClick_Submit" OnClientClick="return searchNotes();" class="fg-button ui-state-default ui-corner-all" style="float: left; margin-left: 20px; width:auto;" Text="Search"></asp:Button>
這一個不
<asp:Button id="btnUpdate" runat="server" onclick="btnClick_Update" onclientclick="return updateNotes();" style="width:auto;" Text="Update" class="fg-button ui-state-default ui-corner-all" />
這兩個事件的OnClientClick呼叫BlockUI返回true。
你的意思是你按下了更新,下拉選擇的值恢復爲默認這是第一個,但不是你之前選擇的一個後? –
提交按鈕正常工作。當我按更新時,我的組合框的選定值將丟失。應用程序不知道選擇了什麼。 – WebSight