I use model binding in my application to get the Information from the view to my model class property.
I just want the entered data from my input form in the properties of my model class without rendering the view again.
The binding works, but i dont know what i have to return in the Controller method.
Model class(Events):
public string EventDay { get; set; }
Controller method:
[HttpPost]
public void Search(Events model)
{
var day = model.EventDay;
}
Html input form:
<form method="post" action="@Url.Action("Search","Book")">
<div id="select-custom" class="box -custom">
<label class="select-custom">
<input class="input-custom" type="date" id="eventDay" name="eventDay" value="dd-mm-yyyy"/>
<button type="submit" id="Search_reservation" class="button-custom display-none">Search</button>
</label>
</div>
</form>