2021年3月28日星期日

How can I attach an action event to a date picker in ASP.NET?

I want to execute a method in the controller when I select a date. I have this:

<input class="form-control col-sm-5" asp-action="SetTimes" asp-for="Date" type="date" value="@DateTime.Today.ToString("dd-MM-yyyy")" />  

The asp-action="SetTimes" was suggested by another student. I wanted it to call the method "SetTimes()" in the controller whenever I pick a date, but it doesn't work.

https://stackoverflow.com/questions/66847416/how-can-i-attach-an-action-event-to-a-date-picker-in-asp-net March 29, 2021 at 08:26AM

没有评论:

发表评论