<form data-ajax="true" data-ajax-mode="replace" data-ajax-update="#results" asp-action="CreateCarClient" asp-controller="Account" method="post" enctype="multipart/form-data">
此表格无效
最佳答案
您正在使用 jQuery Unobtrusive AJAX在 ASP.NET Core 中。您需要使用 npm install jquery.unobtrusive-ajax
将 jquery.unobtrusive-ajax 包安装到您的项目中并在您的 View 中添加对它的引用。
查看 Razor 页面教程here .
This link显示了我如何逐步使用代码的示例。
关于ajax - 如何在 Asp.Net Core 中创建 AJAX 表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53229656/