CKEditor with MVC5 and EF6

2

I put CKEditor in my project. It works fine, but when I click the Save button it returns this error:

  

A possibly dangerous value Request.Form was detected on the client (Content=" <p> <span style="f..."). ")

PS: I already disabled RequestValidation in Web.Config

    
asked by anonymous 17.05.2014 / 19:17

1 answer

3

Place ValidateInput (false) in the method of your Controller , example:

[ValidateInput(false)]
[HttpPost]
public ActionResult CreateOrEdit(Noticia model)
{

}

With this it will not validate your input that sent to your model a html , which by default of MVC can not.

Or

Use AllowHtml as an attribute of your classe , example:

public class Noticia
{
    [AllowHtml]
    public string Texto { get; set; }
}

References:

18.05.2014 / 02:06