您可以添加此属性
[BindProperty]
[BindProperty] public string LoginName { get; set; } [BindProperty] public string Password { get; set; } public async Task<IActionResult> OnPostAsync() { // Login code here }
结果: