【发布时间】:2018-09-05 01:04:36
【问题描述】:
在我正在构建的 blazor 应用程序中,我有以下 cshtml 代码,其中包含一个 <input> 元素供用户输入他们的姓名。我希望能够将输入元素的值绑定到 blazor 页面的 c# 函数部分中的 Name 属性。
我该怎么做?
我的代码如下:
@page "/nameUpload"
<p>
//This is the input element that I would like to bind
Enter your name: <input type="text" ><br />
</p>
@functions {
//This is the property that I want to bind the input to
private string Name { get; set; } = "";
}
【问题讨论】:
标签: c# asp.net-core blazor