ASP.net MVC - handling HTML data in Model
I have a product management page that contains a textarea in which some html is input for the description property of the product. This HTML fragment is stored in a database and displayed later on the product page.
The view HTTP POST's the model data back to the controller.
However, the controller constantly triggers a message: "A potentially dangerous Request.Form value was detected from the client". The only property triggering this message is the property containing the HTML fragment. This occurs even with all the validation turned off. The model, controller and the httpruntime element in web.config are all set to disable validation.
This leads me to the conclusion that i'm probabaly not handling the HTML values of the model correctly.
Any ideas for handling model properties that contain HTML, in both MV开发者_运维问答C and the database? (please base answers on MVC Music store tutorial)
If you are using the latest version then you need to do some less than obvious magic to actually get validation turned off.
精彩评论