MVC从客户端中检测到有潜在危险的 Request.QueryString 值

这种问题有两种方案

方案一:

[ValidateInput(false)]
 public ActionResult Index()
 {
     string ss = Request["rec"];    //客户端输入了res=<table>
   return View();

 }

方案二:

在WebConfig中配置:

<httpRuntime requestValidationMode="2

<pages validateRequest="false"/>.0"/>

原文地址:https://www.cnblogs.com/dongbo19910728/p/4039881.html