I posted a message asking for help on this a few days ago, but sofar no one has replied to it either. The built in save button on the editor does a form submit, which isn't exactly a post back like we woul expect from an asp.net control. It's behaving more like a standard html control.
I checked the code behind fuctions and there doesn't seem to be any handling of the toolbar functions or more specifically the save button.
Unless there is some post information included, I'm thinking there isn't a means to differentiate between a postback and a regular post. That'd be the only way I can see you being able to tell something was "saved" versus the postback happening when a different control on the page is updated. I'm looking further.
The only way I could get it to do what I wanted was make a hidden field and create a plugin to replace the save button on the toolbar, so that when you hit the save button it generates a change event on the hidden field.
I made a hidden field called SaveButtonClicked and put code under its value changed like so:
Protected Sub SaveButtonClicked_ValueChanged(ByVal sender As Object, ByVal e As EventArgs) Handles SaveButtonClicked.ValueChanged
If SaveButtonClicked.Value <> "" Then
'The code below should fire on save button
MsgBox("OMG it worked")
End If
End Sub
I made a new plugin folder in the plugins folder called savea (it could have been called whatever). I also copied the save icon out of the skins/kama/icons.png file and put it in a sub folder called images. plugins/savea/images/save.png I created a plugins.js file in the savea folder plugins/savea/plugins.js inside I put the following:
function CKsavebutton(e) {
var theForm = e.element.$.form;
var h = document.getElementById("SaveButtonClicked");
h.value = 'saved';
theForm.submit();
}
CKEDITOR.plugins.add('savea', {
init: function (a) {
var cmd = a.addCommand('savea', { exec: CKsavebutton })
a.ui.addButton('savea', {
label: 'Save',
command: 'savea',
icon: this.path + "images/save.png"
})
}
})
Also in the CkEditor.net properties I added in the ExtraPlugins property "savea" so that it would be loaded. Under the ToolbarFull property I changed Save to savea. Now when I hit the save button (or actually the savea button), the SaveButtonClicked_ValueChanged event fires.
Re: I am using CKEdit.net and Can't Seem to Save
I checked the code behind fuctions and there doesn't seem to be any handling of the toolbar functions or more specifically the save button.
My topic was "Using CKEditor.NET w/ ASP.NET vb"
Re: I am using CKEdit.net and Can't Seem to Save
Re: I am using CKEdit.net and Can't Seem to Save
I made a hidden field called SaveButtonClicked and put code under its value changed like so:
I made a new plugin folder in the plugins folder called savea (it could have been called whatever).
I also copied the save icon out of the skins/kama/icons.png file and put it in a sub folder called images.
plugins/savea/images/save.png
I created a plugins.js file in the savea folder
plugins/savea/plugins.js
inside I put the following:
Also in the CkEditor.net properties I added in the ExtraPlugins property "savea" so that it would be loaded.
Under the ToolbarFull property I changed Save to savea. Now when I hit the save button (or actually the savea button), the SaveButtonClicked_ValueChanged event fires.