Wednesday, May 11, 2011

Passing Client Side Dates to Server Side Vars With Telerik Rad Controls

Ok, sometimes you need to pass a client side datetime value from a Raddatetimepicker up to the server side for use. Sometimes with localization this can get kind of tricky, but Telerik introduced a new method to make this somewhat less painless.

in javascript
var dt = $telerik.findDatePicker("controlID", null);
  var dtValue = dt.get_selectedDate().format("yyyy/MM/dd");

This method will put your datetime value in a format that is SQL server friendly. Happy coding.

No comments: