I did make the following example, but is not working :
Controller Home:
namespace KendoUIMvcApplication1.Controllers
{
public class HomeController : Controller
{
public ActionResult Index(DateTime? date)
{
//here i use the date bla bla bla
return View();
}
public ActionResult About()
{
return View();
}
}
}
My view : Index.cshtml
<p>
@Html.Kendo().DatePicker().Name("Calendario").Value(DateTime.Now).Events(e =>e.Change("change"))
</p>
<script type="text/javascript">
function change() {
var dado = this.value();
$.ajax({
type: "POST",
url: "/Home/Index", //url
traditional: false,
async: false,
beforeSend: function () {
},
data: dado,
success: function (response) {
},
error: function (e) {
alert("erro");
}
});
}
</script>
Why when I change the date on the calendar, the param is null on the controller? The function $Ajax is working fine; the var dado has a date.