检测到有潜在危险的 Request.Form 值

http://www.cnblogs.com/youring2/p/3559781.html

http://blog.unvs.cn/archives/a-potentially-dangerous-request-form-value.html

http://blog.unvs.cn/archives/vs-debug-question.html

以上是搜索到的连接,我的项目环境是vs2010,mvc4,解决方法是在对应的Action前面加上[ValidateInput(false)]

 

//
        // POST: /RiceChengguo/Create
        [ValidateInput(false)]
        [HttpPost]
        public ActionResult Create(RiceChengguo rChengguo)
        {
            try
            {
                // TODO: Add insert logic here
                rChengguo.Insert();
                return View("AddSuccess", rChengguo);
            }
            catch
            {
                return View();
            }
        }

 

posted @ 2015-09-28 10:58  _海阔天空  阅读(233)  评论(0编辑  收藏  举报