In my custom model binder I use
bindingContext.ValueProvider.GetValue(propertyName);
I do have [ValidateInput(false)] on the action. However the GetValue call above results in
A potentially dangerous Request.QueryString value was detected from the client
How do I make my custom model binder get the unvalidated value from the value provider? Of course when it finds that there’s ValidateInput(false) on the action.
Just in case someone is curious, here’s a quick solution. Just call CheckUnvalidated() in BindModel/BindProperty methods. This will replace default QueryStringValueProvider with the unvalidated version.