Does MVC 3 support Xml data? I have a model class with a field (call it ‘MyCustomersXml’), and I want to stuff it into a hidden field. The issue I’m having is that I get a 500 error when the user clicks a submit button. If the field is null, nothing happens.
I know ASP.Net does some type of validation by default to prevent html style content in control values, so my question is does MVC 3 also share this behavior? If so, how do I bypass this behavior to allow Xml in the postback?
You could decorate this field with the
[AllowHtml]attribute:Now the ASP.NET framework will no longer throw an exception when you try to POST dangerous characters such as
<and>in this field.