This is a migrated thread and some comments may be shown as answers.

[Solved] Extra ; at end of text

2 Answers 20 Views
Editor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Neil
Top achievements
Rank 1
Neil asked on 04 Jul 2011, 01:47 PM
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:
<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();
    }
}

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 04 Jul 2011, 04:32 PM
Hi Neil,

 This is a very weird issue. I tried to reproduce it in our online demos to no avail. Can you reproduce it there? Does it appear in more than one browser? What is the HTML you are testing with?

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Neil
Top achievements
Rank 1
answered on 04 Jul 2011, 09:34 PM
Thanks, you pointed me in the right direction!

Force of habit on my part putting a colon at the end of the list view!

Thanks,
Neil
Tags
Editor
Asked by
Neil
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Neil
Top achievements
Rank 1
Share this question
or