Search code examples
asp.net-mvc-3ckeditorasp.net-mvc-ajax

ajax.actionlink post form not showing ckeditor


After Using the Ajax.ActionLink As

@Ajax.ActionLink("Edit", "AddEdit", new { @id = id, @recId = item.EncyclopediaID }, new AjaxOptions { InsertionMode = InsertionMode.Replace, UpdateTargetId = "listForm" }, new { @class = "edit_icon", @title = "edit this item" })

And When Controller Go to AddEdit Page There i have Uploaded the File and want to show the Ckeditor.

So i use

@using (Html.BeginForm("AddEdit", "Encyclopedia", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
   /////////other code//////////////////
    @Html.EditorFor(model => model.Description,"CKEditor")
}

Now if i use to show the @Html.ActionLink instead of @Ajax.Actionlink Ckeditor Shows perfectly and in Ajax call it showed like a textarea.

Please Help.


Solution

  • this happens because resource files required for ckeditor to work correctly (eg: css , javascript) cannot be downloaded with an ajax call. try referencing the required resource files in layout view page and try again.

    Edit :

    maybe you have placed integration code in document.ready function, thus after ajax request completed and you markup changed, the new markup (eg:your new input element) is not configured as ckeditor input.so try calling ckeditor integration code after ajax success.