mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-08 00:14:31 +08:00
Compare commits
1 Commits
issue/8686
...
revert-841
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5360b84a0f |
@@ -16,7 +16,6 @@ namespace Orchard.Mvc.ModelBinders {
|
||||
|
||||
public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) {
|
||||
var value = false;
|
||||
if (string.IsNullOrWhiteSpace(controllerContext.HttpContext.Request[bindingContext.ModelName])) return false;
|
||||
var requestBooleanValue = controllerContext.HttpContext.Request[bindingContext.ModelName].Split(',')[0]; //Html.CheckBox and Html.CheckBoxFor return "true,false" string
|
||||
if (!bool.TryParse(requestBooleanValue, out value)) {
|
||||
bindingContext.ModelState.AddModelError(bindingContext.ModelName, new FormatException());
|
||||
|
Reference in New Issue
Block a user