Hi!
I'm working with CKEditor for ASP.NET in Visual Studio 2010 and MVC2. My problem is that I can´t find the way to pass, directly to the tag "CKEditor:CKEditorControl", the value of the text that is stored with a model in a Strongly-Typed View.
I got the values in the view but I don't know how to display them in CKEditor so that the user can edit it.
I also tried with:
How would I recover from the controller the edited text in the view?
Thanks in advance
I'm working with CKEditor for ASP.NET in Visual Studio 2010 and MVC2. My problem is that I can´t find the way to pass, directly to the tag "CKEditor:CKEditorControl", the value of the text that is stored with a model in a Strongly-Typed View.
I got the values in the view but I don't know how to display them in CKEditor so that the user can edit it.
public class HomeController : Controller { public ActionResult Index() { ModelContent newContent = new ModelContent (); newContent .title = "Title"; newContent .text = "Value of the text"; return View(newContent ); }
<form id="form1" runat="server"> <fieldset> <legend>Fields</legend> <div class="editor-label"> <%: Html.LabelFor(model => model.title ) %> </div> <div class="editor-field"> <%: Html.TextBoxFor(model => model.title ) %> <%: Html.ValidationMessageFor(model => model.title ) %> </div> <div class="editor-field"> <CKEditor:CKEditorControl ID="text" runat="server"> <%: Html.DisplayTextFor(model => model.text)%> </CKEditor:CKEditorControl> </div> <p> <input type="submit" value="Create" /> </p> </fieldset> </form>
I also tried with:
<CKEditor:CKEditorControl ID="text" runat="server" Text="<%= model.text%>"> </CKEditor:CKEditorControl>
How would I recover from the controller the edited text in the view?
Thanks in advance