This question is locked. New answers and comments are not allowed.
I've been playing with the editor control in MVC 3 Razor and have a bizarre situation where an extra ";" is always added to the end of the text.
I am not sure why this is happening. I can get rid of it using a substring but I would like to know exactly why it is happening.
Any ideas?
Thanks,
Neil
View snippet:
Controller: (I've used "string article" as the content of the editor control is not being passed in the collection and I found this work around elsewhere in the forum)
I am not sure why this is happening. I can get rid of it using a substring but I would like to know exactly why it is happening.
Any ideas?
Thanks,
Neil
View snippet:
<div class="editor-label"> @Html.LabelFor(model => model.Article)</div> <div class="editor-field"> <div class="t-editor"> @(Html.Telerik().EditorFor(model => model.Article) .Name("Article") .Encode(true) .HtmlAttributes(new { style = "height:200px" }) ) </div></div>Controller: (I've used "string article" as the content of the editor control is not being passed in the collection and I found this work around elsewhere in the forum)
public ActionResult Create(FormCollection collection, string article){ try { ClubMembersEntities entities = new ClubMembersEntities(); NewsArticle newsArticle = new NewsArticle(); bool announcement = false; if (collection["Announcement"] == "true") { announcement = true; } newsArticle.Announcement = announcement; newsArticle.Article = article;//article.Substring(0,article.Length-1); newsArticle.Title = collection["Title"]; entities.NewsArticles.AddObject(newsArticle); entities.SaveChanges(); return RedirectToAction("Index"); } catch (Exception ex) { return View(); }}