mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Compare commits
1 Commits
9de766de29
...
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