您有几种选择。
在模型上,将此属性添加到允许HTML所需的每个属性中- 最佳选择
using System.Web.Mvc;
[AllowHtml]
public string SomeProperty { get; set; }
在控制器操作上,添加此属性以允许所有HTML 
[ValidateInput(false)]
public ActionResult SomeAction(MyViewModel myViewModel)
web.config中的暴力破解- 绝对不建议
在web.config文件的标记内,插入带有属性requestValidationMode =“ 2.0”的httpRuntime元素。还要在pages元素中添加validateRequest =“ false”属性。
<configuration>
  <system.web>
   <httpRuntime requestValidationMode="2.0" />
  </system.web>
  <pages validateRequest="false">
  </pages>
</configuration>
更多信息:http : //davidhayden.com/blog/dave/archive/2011/01/16/AllowHtmlAttributeASPNETMVC3.aspx
以上适用于默认modelbinder的用法。 
自定义ModelBinder
似乎在上面的代码中对bindingContext.ValueProvider.GetValue()的调用始终会验证数据,而不考虑任何属性。深入研究ASP.NET MVC源,可以发现DefaultModelBinder首先检查是否需要验证请求,然后使用指示是否需要验证的参数调用bindingContext.UnvalidatedValueProvider.GetValue()方法。
不幸的是,我们不能使用任何框架代码,因为它们是密封的,私有的或用于保护无知的开发人员避免从事危险工作的任何方法,但是创建一个尊重AllowHtml和ValidateInput属性的有效的自定义模型绑定程序并不难:
public class MyModelBinder: IModelBinder
{
    public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
    {
        // First check if request validation is required
        var shouldPerformRequestValidation = controllerContext.Controller.ValidateRequest && bindingContext.ModelMetadata.RequestValidationEnabled;
        // Get value
        var valueProviderResult = bindingContext.GetValueFromValueProvider(shouldPerformRequestValidation);
        if (valueProviderResult != null)
        {
            var theValue = valueProviderResult.AttemptedValue;
            // etc...
        }
    }
}
另一个必需的部分是检索未验证值的方法。在此示例中,我们对ModelBindingContext类使用扩展方法:
public static class ExtensionHelpers
{
    public static ValueProviderResult GetValueFromValueProvider(this ModelBindingContext bindingContext, bool performRequestValidation)
    {
        var unvalidatedValueProvider = bindingContext.ValueProvider as IUnvalidatedValueProvider;
        return (unvalidatedValueProvider != null)
          ? unvalidatedValueProvider.GetValue(bindingContext.ModelName, !performRequestValidation)
          : bindingContext.ValueProvider.GetValue(bindingContext.ModelName);
    }
}
有关更多信息,请访问http://blogs.taiga.nl/martijn/2011/09/29/custom-model-binders-and-request-validation/