We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Saving Content of RichTextEditor in Edit Controller [HttpPost]

I am using @Html.Syncfusion().RichTextEditor("RTE").Text(Model.Definition).ShowHtmlSource(false).AllowEdit(true) in my View/Edit.cshtml and the data is displayed fine.
 
Then, I would like to save my changes.  I am having difficulty retrieve the "RTE" content in the Edit Controller [HttpPost] using the following:
 
[HttpPost]
public ActionResult Edit(int id, FormCollection formCollection, string[] selectedPulldownData)
{
 //formCollection["RTE"]
}
 
In the debugger, I can see the formCollection["RTE"] value but is unable to retrieve the Rich Text Content.
 
Sorry if this is a simple question.  I am new at MVC/RAZOR/Syncfusion and in the process of trying to learn them all at the same time. Help!

1 Reply

VR Varalakshmi R.S Syncfusion Team March 4, 2013 07:21 AM UTC

Hi Marie,

 

Thanks for contacting Syncfusion forums.

 

We suggest you to use RichTextControl ‘s id in action arguments for retrieving the content of RTE. Please refer the below code snippet to achieve this,

<code>

[View]

@Html.Syncfusion().RichTextEditor("RTE").Text(Model.Definition).ShowHtmlSource(false).AllowEdit(true)

 

[Controller]

[HttpPost]

        public ActionResult Edit(int id, string RTE, string[] selectedPulldownData)

        {

            //RTE returns the content in RichTextEditor

        }

</code>

 

Kindly try the above suggested solution and let us know if it helps.

 

Regards,

Varalakshmi

Loader.
Live Chat Icon For mobile
Up arrow icon