我有以下PageModel:
public class EmailSettingsModel : AuthorizedPageModel
{
[BindProperty]
public EmailSettingsModel mdl { get; set; }
public void OnGet()
{
}
}
public class EmailSettingsViewModel
{
public string IfrToAddress { get; set; }
}
,然后是以下CSHMTL代码段:
<div class="form-group">
<label class="form-label font-weight-bold">To: Address</label>
<input asp-for="mdl.IfrToAddress" class="form-control mb-1">
<small class="text-muted">Can be more than one address, but MUST be seperated by a semi-colon (;) between each address.</small>
</div>
我不明白的是为什么IfrToAddress属性无法编译。
我想将PageModel和ViewModel分成单独的类,以使我的页面模型不会被顶部的属性所阻塞。但是此代码无法使用我拥有CSHTML的符号进行编译。