I've looked all over for an answer to this question; maybe I'm missing something, but I can't figure it out...
I'm trying to call my custom C# (or visual basic will work too) function (doDocSave) when a user clicks the "save" button in the FCKeditor toolbar, but I'm not having any luck.
I've tried using javascript in my aspx like so:
but doing this results in doDocSave() being called everytime the page is loaded, which is definately not desirable. I guess I just dont know enough about ASPX to understand what's going on. Is there a way to do something like "<form name="..." onsubmit="doDocSave()">?
If someone could point me to a good resource to accomplish my task, or maybe provide a snippet, I will be incredibly grateful.
I'm trying to call my custom C# (or visual basic will work too) function (doDocSave) when a user clicks the "save" button in the FCKeditor toolbar, but I'm not having any luck.
I've tried using javascript in my aspx like so:
<script language="javascript"> MyCustomSave() { <% doDocSave(); %> } </script>
but doing this results in doDocSave() being called everytime the page is loaded, which is definately not desirable. I guess I just dont know enough about ASPX to understand what's going on. Is there a way to do something like "<form name="..." onsubmit="doDocSave()">?
If someone could point me to a good resource to accomplish my task, or maybe provide a snippet, I will be incredibly grateful.
Re: Calling my C# or Visual Basic function on Save.
For my need, I have replaced the save button with a Prototype Ajax.Request. I may provide the viable source portions if you'd like.
Re: Calling my C# or Visual Basic function on Save.
Thanks for your help!
Re: Calling my C# or Visual Basic function on Save.
Re: Calling my C# or Visual Basic function on Save.
You are mixing up client and server code. Your editor is in a form on the page and when you click the submit button (which you have to provide on your own) or click the toolbar button and the editor submits the form on your behalf, a request is made to the server with all text you entered passed within that request. This is where your server code comes in and processes this request. Take a look at these links:
http://www.w3schools.com/ASP/asp_inputforms.asp
http://www.w3schools.com/aspnet/aspnet_forms.asp
Andre
Re: Calling my C# or Visual Basic function on Save.
Give the following a try: