ASP.NET MVC A potentially dangerous Request.Form value was detected from the client when using a custom modelbinder

前端 未结 5 1906
感情败类
感情败类 2020-11-29 18:44

Getting the error here:

ValueProviderResult value = bindingContext.ValueProvider.GetValue(\"ConfirmationMessage\");

How do I allow on a sel

5条回答
  •  误落风尘
    2020-11-29 19:39

    Expanding upon the answer from @D-W, in my Edit controller, in iterating over form values, I had to replace all instances of Request.Params.AllKeys with Request.Unvalidated.Form.AllKeys and all instances of Request[key] with Request.Unvalidated.Form[key].

    This was the only solution that worked for me.

提交回复
热议问题