views:

92

answers:

3

I need to setup an ASP.Net MVC view with a Date Picker that will send a postback to the controller when it is changed with its new date. I know there is a Date Picker in JQuery, but how would i get it to send the data to the controller?

+1  A: 

You could just attach something to the onchange on that element.

...
$("#datapicker").change(function(){
   $.post('someurl', data);
 }
...
stimms
+1  A: 

The jQuery Datepicker has an option named onSelect. You can pass a function to that option to post the data to server-side.

$("#datepicker").datepicker({
   onSelect: function(dateText, instance) {
       //post the data here
   }
});
çağdaş
+1  A: 

There are few nice articles on ASP.NET MVC with very fine details at: http://www.altafkhatri.com/Technical/How%5Fto%5Fbind%5FIList%5Fwith%5FMVC%5FDropdownlist%5Fbox

rajuyusuf