0

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?

2 Answers 2

1

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

...
$("#datapicker").change(function(){
   $.post('someurl', data);
 }
...
Sign up to request clarification or add additional context in comments.

Comments

1

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
   }
});

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.