Note that there are some explanatory texts on larger screens.

plurals
  1. POProblem binding action parameters using FCKeditor, AJAX and ASP.NET MVC
    primarykey
    data
    text
    <p>I have a simple ASP.Net MVC View which contains an FCKeditor text box (created using FCKeditor's Javascript ReplaceTextArea() function). These are included within an Ajax.BeginForm helper:</p> <pre><code>&lt;% using (Ajax.BeginForm("AddText", "Letters", new AjaxOptions() { UpdateTargetId = "addTextResult" })) {%&gt; &lt;div&gt; &lt;input type="submit" value="Save" /&gt; &lt;/div&gt; &lt;div&gt; &lt;%=Html.TextArea("testBox", "Content", new { @name = "testBox" })%&gt; &lt;script type=""text/javascript""&gt; window.onload = function() { var oFCKeditor = new FCKeditor('testBox') ; var sBasePath = '&lt;%= Url.Content("~/Content/FCKeditor/") %&gt;'; oFCKeditor.BasePath = sBasePath; oFCKeditor.ToolbarSet = "Basic"; oFCKeditor.Height = 400; oFCKeditor.ReplaceTextarea() ; } &lt;/script&gt; &lt;div id="addTextResult"&gt; &lt;/div&gt; &lt;%} %&gt; </code></pre> <p>The controller action hanlding this is:</p> <pre><code>[ValidateInput(false)] public ActionResult AddText(string testBox) { return Content(testBox); } </code></pre> <p>Upon initial submission of the Ajax Form the testBox string in the AddText action is always "Content", whatever the contents of the FCKeditor have been changed to. If the Ajax form is submitted again a second time (without further changes) the testBox paramater correctly contains the actual contents of the FCKeditor.</p> <p>If I use a Html.TextArea without replacing with FCKeditor it works correctly, and if I use a standard Post form submit inplace of AJAX all works as expected.</p> <p>Am I doing something wrong?</p> <p>If not is there a suitable/straight-forward workaround for this problem?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload