Answer the question
In order to leave comments, you need to log in
How to pass DateTime from View to Controller?
Actually a subject. Here is the View
@model HotelSite.ViewModels.OrderViewModel
<h2>Заказать номер</h2>
<form method="post" asp-controller="Order" asp-action="Index">
<div asp-validation-summary="ModelOnly"></div>
<div>
<label asp-for="StartDate"></label><br />
<input type="date" asp-for="StartDate" />
<span asp-validation-for="StartDate"></span>
</div>
<div>
<label asp-for="EndВate"></label><br />
<input type="date" asp-for="EndВate" />
<span asp-validation-for="EndВate"></span>
</div>
<div>
<input type="submit" value="Забронировать" />
</div>
</form>
public IActionResult Index(OrderViewModel model)
{
return View();
}
Answer the question
In order to leave comments, you need to log in
Could this be of any help? https://www.youtube.com/watch?v=dsk4YyDEn4w
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question