I have an asp action that has multiple parameters that need to be passed to the controller. Some of the variables can change based on actions on the page, for instance I have a date picker so the user can choose what date they want.
When they change the date that date is saved as a Javascript variable.
<script>
$('#pvHistoricalDates').on('change', '#date', function (ev, picker) {
date = $(this).find("option:selected").val();
});
</script>
Is there anyway for me to insert that variable value into the following asp-action without creating just creating a URL. I am aware of that solution but I am curious if I can just insert it directly as a variable.
<a asp-action="LoadData" asp-route-account="@Model.Account" asp-route-date="???">Button</a>