<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> <a class="click-on-link" href="#">show datepicker</a>
<script type="text/javascript"> function showDate(date) { //alert('The date chosen is ' + date); } $(function() { $('#ctl00_ContentPlaceHolder1_TextBox2').datepick(); // assign anonimous function as event handler and call showdate from it $('#clickOnIt').click( function() { showDate( $(this).val() ); } ); }); </script>