Given:
Where the id = datepicker tells the javascript to attach all the datepicker code to
I think it's a good practice to have a class which triggers a date picker to be created for everything that has it, such as 'js-date-picker'
then to avoid duplication of code, you can just write the following JS once:
$(document).ready(function() {
$(".js-date-picker").datepicker();
});
to get ASP.net to set a class on the textbox correctly so it uses this class, just add CssClass="js-date-picker" to the tag:
Hope this clarifies things for you.