I have a textbox to select Date and there is one action link in the razor page to redirect to another page with date value as one of the parameter. Is there any way to dynamically change the value of actionlink whenever a user change the date. My Razor view is like

<div class="col-md-4">
    @Html.TextBoxFor(model => model.Date, new { @class = "datepicker form-control" })
    @Html.ValidationMessageFor(model => model.Date)
</div>
@Html.ActionLink("Mark Attendance", "Add", "Attendance", new { @id = @model.ClassId }, new { @class = " btn btn-primary"})

And in Javascript i have been able to do

$("#Date").datepicker({ showOn: 'both', altFormat: 'MM-dd-yy', dateFormat: 'MM-dd-yy', changeMonth: true, changeYear: true, yearRange: "1900:2050" }) .change(dateChanged) .on('changeDate', dateChanged);

      function dateChanged(ev) {
     //How can i change the action link in a way that add an extra param date with selected value ?
    }

Is there any way to do it?

Related posts

Recent Viewed