MVC從客戶端中檢測到有潛在危險的 Request.QueryString 值

這種問題有兩種方案blog

方案一:string

 

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

 }

 

方案二:io

在WebConfig中配置:table

<httpRuntime requestValidationMode="2class

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

相關文章
相關標籤/搜索