Use ClientID
to get the generated Id
of a server side control:
$("#<%=dateTo.ClientID%>").datetimepicker();
ASP.NET will generate a specific id
attribute that is different from the id
attribute of the server side control, so you need to use the generated value in order to access it from jQuery.