mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-08 00:14:31 +08:00
Revert "Fix/8392 remeber me model state exception (#8410)"
This reverts commit 3ceda381c5
.
This commit is contained in:

committed by
GitHub

parent
3ceda381c5
commit
5360b84a0f
@@ -16,7 +16,6 @@ namespace Orchard.Mvc.ModelBinders {
|
|||||||
|
|
||||||
public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) {
|
public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) {
|
||||||
var value = false;
|
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
|
var requestBooleanValue = controllerContext.HttpContext.Request[bindingContext.ModelName].Split(',')[0]; //Html.CheckBox and Html.CheckBoxFor return "true,false" string
|
||||||
if (!bool.TryParse(requestBooleanValue, out value)) {
|
if (!bool.TryParse(requestBooleanValue, out value)) {
|
||||||
bindingContext.ModelState.AddModelError(bindingContext.ModelName, new FormatException());
|
bindingContext.ModelState.AddModelError(bindingContext.ModelName, new FormatException());
|
||||||
|
Reference in New Issue
Block a user