I am trying to implement a calendar control and using jquery calendar for it. I want to make some date clickable. By default all dates in the UI are click able. I only want to make those dates click able which are from Database and I want to access the value (of what date is clicked) in C#. If user click on a date I want to show a pop up and do database operation from C#.
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
I have implemented the control successfully but can not figure out how to pass the date clicked in Code behind (.cs) file
Any idea how should I go for it.
UPDATE
<script>
$(document).ready(function () {
var enabledDays = ['11-30-2013', '12-14-2013', '12-21-2013', '01-11-2014', '01-11-2014', '01-25-2014', '02-08-2014', '02-22-2014', ]
function enableAllTheseDays(date) {
var m = date.getMonth(),
d = date.getDate(),
y = date.getFullYear();
for (i = 0; i < enabledDays.length; i++) {
if ($.inArray((m + 1) + '-' + d + '-' + y, enabledDays) != -1) {
return [true];
}
}
return [false];
}
$('#datepicker').datepicker({
dateFormat: 'mm-dd-yyyy',
beforeShowDay: enableAllTheseDays
});
});
</script>