【发布时间】:2018-05-12 06:46:43
【问题描述】:
我有以下 HTML:
<label asp-for="CurrentLocation.Description" class="text-info"></label>
在绑定模型中:
public class NavigationModel : PageModel
{
public void OnGet()
{
CurrentLocation = new Location()
{
Description = "test"
};
}
[BindProperty]
public Location CurrentLocation { get; set; }
}
所以,根据我对 RazorPages 的理解,该站点应该显示“测试”;但相反,它显示“描述”。我看过几个例子,这些例子都很好,但我不明白为什么我的版本可能会有所不同。谁能指出我正确的方向?
【问题讨论】:
标签: c# razor-pages asp.net-core-tag-helpers