【发布时间】:2022-09-23 00:45:03
【问题描述】:
我有一个页面处理程序,它具有用于模型绑定的复杂属性。我想访问剃刀页面的属性,以便我可以使用标签助手从属性生成表单输入。
这是我的页面处理程序:
public async Task<IActionResult> OnPostChangePassword(PasswordChangeInput Input)
{
// Some code
}
我想访问该属性,以便可以将其与asp-for 一起使用
@page
@model EditPasswordModel
@
{
//Some code
}
<form method=\"post\">
<div class=\"flex justify-between my-1\">
<label class=\"text-gray-700\" for=\"cus_name\">Password:</label>
<input asp-for=\"Input.Password\" class=\"px-3 py-1 text-gray-900\" />
</div>
<div class=\"flex justify-between my-1\">
<label class=\"text-gray-700\" for=\"cus_name\">Confirm Password:</label>
<input asp-for=\"Input.ConfirmPassword\" class=\"px-3 py-1 text-gray-900\" />
</div>
<div>
<input type=\"submit\" />
</div>
</form>
-
我正在使用 ASP.NET Core Razor 页面
标签: c# asp.net asp.net-core razor razor-pages