i have used Jquery Calendare which works well. for that i have used
"jquery-ui.min.js" and "jquery-ui.css" Library File.
i can show the calender, show the current date. Also i can highlight the task set dates.
But what i cant do is, when user click on any date, i cant get the event. i want the user to redirect to another page with selected date. but i am not able to get event on the date.
The vierd thing is, on blank area of calendar i get the event, and also i can get the selected date value, but when user clicks on date, that time i dont get any event.
I have attached code for your reference. Any idea to solve the issue?
Site Master Page
-----------------------------------
<script type="text/javascript" src="../../Scripts/jquery-ui.min.js"></script>
<link href="../../Content/jquery-ui.css" rel="stylesheet" type="text/css" />
Calendar Page
------------------------------------------------------------------------------------
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
ShowCalendar
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>ShowCalendar</h2>
<script type="text/javascript">
$(function () {
var someDates = ['10/8/2011', '10/28/2011', '10/30/2011', '11/7/2011', '12/7/2011'];
$("#testDateDiv").datepicker({
beforeShowDay: function (date) {
for (var i = 0; i < someDates.length; i++) {
if (new Date(someDates[i]).toString() == date.toString()) {
return [true, 'someDates'];
}
}
return [true];
}
});
});
$(function () {
debugger;
if ($("#testDateDiv").click(function () {
var obj1 = $('#testDateDiv').val();
$('#' + $('#DateDiv').val()).datepicker('setDate', obj1);
alert(obj1);
}));
});
</script>
<div id="testDateDiv" style="width: 300px">
</div>
</asp:Content>