I have a Kendo Editor which is defined as below:
@(Html.Kendo().Editor()
.Name("myEditor")
.Tag("div")
.Tools(tools => tools
.Clear()
.Bold()
.Italic()
.Underline()
.Strikethrough()
.JustifyCenter().JustifyFull().JustifyLeft().JustifyRight()
.CreateLink().Unlink().TableEditing().FontColor().BackColor())
.Value(@<text>
Hello Kendo Editor <some text with html tags here>
</text>)
)
Then I have two buttons that show up only for the admins - Save and Edit, and they are defined as below -
<
button
type
=
"button"
id
=
"btnedit"
>Edit</
button
>
<
input
type
=
"submit"
name
=
"btnSave"
id
=
"btnSave"
value
=
"Save"
class
=
"btn btn-default"
/>
There are other two submit buttons on the form like below -
<
input
type
=
"submit"
name
=
"btnAgree"
id
=
"btnAgree"
value
=
"Agree"
class
=
"btn btn-primary"
/>
<
input
type
=
"submit"
name
=
"btnDisagree"
id
=
"btnDisagree"
value
=
"Disagree"
class
=
"btn btn-default"
/>
And the form handles the submit of Agree and Disagree buttons by using the BeginForm("ActionMethod", "Controller", FormMethod.Post) like below -
@using (Html.BeginForm("Index", "MyControllerName", FormMethod.Post))
Now I want that, when an admin user comes in and makes changes to the Editor text and hits 'Save' button, I want the text of the editor to get saved in database. I can handle the saving part. I just want to know, how can I get the text from the Kendo Editor and send the text value to the action method in the controller.
I tried the solution provided in this thread here - http://www.telerik.com/forums/save-changes-to-and-print-content-of-editor-in-mvc
So, using the solution here I added an action method with the string argument name similar to the Editor name like below -
public ActionResult Save(string myEditor) {
// TO DO: Save the text to the database
}
When I run my application, and hit 'Save' button, I get the below error -
HTTP Error 404.0 - Invalid navigation
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
It does not hit the 'Save' Action method. How can I get that working?
Thanks