小编Aru*_*Kat的帖子

无法 MudDatePicker 如何将其绑定到数据模型

<EditForm Model="@_newRegister" OnValidSubmit="@HandleValidSubmit">
  <DataAnnotationsValidator />
  <ValidationSummary />
  <div class="container-fluid">
    <div class="row">
     <div class="col-6">
      <div class="form-group">
        <MudDatePicker Label="Collection Date" Editable="true" @bind-Date="_newRegister.CollectionDate" />
      </div>
     </div>
    </div>
  </div>
</Editform>

@code{
private Register _newRegister = new x.Shared.Register
{
    ProcessingDate = DateTime.Today,
    CollectionDate = DateTime.Today,
    ModifiedDate = DateTime.Today,
    CreateDate = DateTime.Today
};

private string Success = "";
DateTime? date = DateTime.Today;

public void HandleValidSubmit()
{

    Success = "Success";

}
)
Run Code Online (Sandbox Code Playgroud)
public class Register
{
    [Key]
    public int ID { get; set; }
    public String CustomerName …
Run Code Online (Sandbox Code Playgroud)

c# .net-5 blazor-webassembly

7
推荐指数
1
解决办法
1217
查看次数

标签 统计

.net-5 ×1

blazor-webassembly ×1

c# ×1