开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜