.net core 3.1 date field bind issue
.NET (Core and Framework)
1
Posts
1
Posters
0
Views
1
Watching
-
-- User.cshtml.cs --
[BindProperty]
public InputModel Input { get; set; }public class InputModel
{
...
[Required]
[DataType(DataType.Date)]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd.MM.yyyy}")]
[Display(Name = "Date of Birth")]
public DateTime BirthDate { get; set; }
}private async Task LoadAsync(UserModel user)
{
Input = new InputModel
{
BirthDate = user.BirthDate // 1990-01-01 00:00:00
};
}public async Task OnGetAsync()
{
...
await LoadAsync(user);
return Page();
}-- User.cshtml --
// Result Page View What should i do to show the date of birth?