在ASP.Net Core MVC中使用Bootstrap 4模态框提交表单时,可能会遇到表单提交不起作用的问题。以下是一种解决方法,其中包含了代码示例:
[HttpPost]
public IActionResult Action(ModelName model)
{
if (ModelState.IsValid)
{
// 执行表单提交后的操作
...
return RedirectToAction("Success");
}
else
{
return View(model);
}
}
通过以上步骤,您可以在ASP.Net Core MVC中使用Bootstrap 4模态框提交表单,并解决表单提交不起作用的问题。