开发者

ASP.NET MVC jQuery DatePicker Navigate to page on select date

开发者 https://www.devze.com 2023-01-07 22:41 出处:网络
I\'m using the JQuery DatePicker as a little Calendar Dashboard, marking dates with \"agenda items\" (events, office closed, meetings ...).

I'm using the JQuery DatePicker as a little Calendar Dashboard, marking dates with "agenda items" (events, office closed, meetings ...).

The dates are marked and clickable, but now I'd like to navigate to the "Day Detail" when the user clicks on one of the dates.

Here's what I have so far, but I'm missing (see ???) how I can append the selected date to the Url.Action method:

    $(document).ready(function() {
        $("#eventCalendar").datepicker({
            numberOfMonths: 3,
            beforeShowDay: highlightDays,
            onSelect: function(date, instance){
                win开发者_开发知识库dow.location = '<%= Url.Action("Items", "Calendar", new { date = ???}) %>';
            }
        });
        });


window.location = '<%= Url.Action("Items", "Calendar") %>?date=' + encodeURIComponent(date);
0

精彩评论

暂无评论...
验证码 换一张
取 消