From 3d8ae5860a700b37ff001c4e0a293f6afe05f5ca Mon Sep 17 00:00:00 2001
From: lonix1 <40320097+lonix1@users.noreply.github.com>
Date: Mon, 1 Jan 2024 20:04:34 +0200
Subject: [PATCH 1/5] split remote demo
---
Controllers/Validations.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Controllers/Validations.cs b/Controllers/Validations.cs
index 28d793e..262380d 100644
--- a/Controllers/Validations.cs
+++ b/Controllers/Validations.cs
@@ -11,9 +11,9 @@ public IActionResult CheckRemote(string id)
}
[HttpPost]
- public IActionResult CheckboxRemote(bool isChecked)
+ public IActionResult CheckboxRemote(bool isCheckedRemote)
{
- return Ok(isChecked);
+ return Ok(isCheckedRemote);
}
[HttpGet]
From 71d64992d9ecab8e668da33113176f35ad85e1aa Mon Sep 17 00:00:00 2001
From: lonix1 <40320097+lonix1@users.noreply.github.com>
Date: Mon, 1 Jan 2024 20:08:07 +0200
Subject: [PATCH 2/5] split remote demo
---
Pages/Demos/Checkboxes.cshtml.cs | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/Pages/Demos/Checkboxes.cshtml.cs b/Pages/Demos/Checkboxes.cshtml.cs
index 7501d91..ca18837 100644
--- a/Pages/Demos/Checkboxes.cshtml.cs
+++ b/Pages/Demos/Checkboxes.cshtml.cs
@@ -27,6 +27,9 @@ public IActionResult OnPost()
[BindProperty]
public InputModel Input { get; set; } = new();
+ [BindProperty]
+ public InputModelRemote InputRemote { get; set; } = new();
+
[BindProperty]
[Required]
public List
- One can also use the [Remote] validation attribute. In this case, the remote validator returns valid only when the checkbox is checked.
+ One can also use the [Remote]
validation attribute with checkboxes.
+ This checkbox's remote validator returns valid only when it matches the one above.
+ Note: Changes to
+ additional fields
+ do not automatically revalidate.