I have this in view:\[code\]$('#datepicker').datepicker({ onSelect: function (date, inst){ $(this).parent('form').submit(); }});<form method="post" name="datepickerForm"> <div id="datepicker"></div></form>Date Posted: @ViewBag.PostedDate\[/code\]in the controller, I have:\[code\]public ActionResult Index(int? datepickerForm) { if(datepickerForm.HasValue) // this is always null ViewBag.PostedDate = datepickerForm.Value;}\[/code\]