ValidateRequest="false" doesn't work when posting HTML values

Posted by Ivan90 on Stack Overflow See other posts from Stack Overflow or by Ivan90
Published on 2010-05-14T17:06:26Z Indexed on 2010/05/14 21:14 UTC
Read the original article Hit count: 219

Filed under:

I am developing a personal blog in ASP.NET MVC 1.0. This blog application has Views like "Insert Post", "Edit Post", etc. I need to post a string containing HTML back to the appropriate controller method. That HTML value is being posted from a textarea.

I've read that it's necessary to disable ValidateRequest directly on the page with the attribute ValidateRequest = "false" or in the web.config file.

When I insert an HTML value in my textarea, I get always the error of 'potential value dangerous'.

How can I use ValidateRequest to allow the form element containing HTML values to be posted?

© Stack Overflow or respective owner

Related posts about asp.net-mvc