0

We have an admin page that contains a text editor. You can make items bold or format it in other ways. Behind the scenes it's being stored as html. When the user clicks save we want to save the actual value. So if the value is <p> <strong> hey </strong> </p> we want to save those exact values and the next time the user comes to the page it'll be rendered the way they left it. The problem is I'm encountered with this error:{"A potentially dangerous Request.Form value was detected from the client (MyItem.Synopsis=\"<strong>My Test</str...\")."}

Any idea on how to save input that contains html input? I just want to do it for this page. The rest of the site should not allow it.

auwall12688
  • 389
  • 3
  • 11
  • 23

1 Answers1

1

Similar question here: Allow User to input HTML in ASP.NET MVC - ValidateInput or AllowHtml

It seems you can add an [AllowHtml] attribute to the field.

Community
  • 1
  • 1
Platte Gruber
  • 2,935
  • 1
  • 20
  • 26