Hi @Kmcnet
In an ASP.NET Core MVC application, you can bind the checkbox to a model property by using Tag Helper.
1.Model
public class YourModel
{
public bool IsChecked { get; set; }
}
2.View
@model YourModel
<input type="checkbox" asp-for="IsChecked" />
3.Controller
public IActionResult Index()
{
var model = new YourModel { IsChecked = true }; // Set default value here if needed
return View(model);
}
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Rena