<script>
$(function() {
$("input[id*=tbStartTime]").datepicker({ showOn: "both", buttonImage: "../images/gesplus/calendar.gif", buttonImageOnly: true, dateFormat: "yy/mm/dd" });
});
</script>
<style>
//調整圖片位置
.ui-datepicker-trigger { margin-left:5px; margin-top: 5px; margin-bottom: -6px; }
</style>
</head>
<asp:TextBox ID="tbStartTime" runat="server" Columns="10"></asp:TextBox>
參考資料:
http://blog.xuite.net/tolarku/blog/213867131-%5BAsp.net%5D+%E9%81%B8%E6%93%87%E6%97%A5%E6%9C%9F+Calendar+%E4%BD%BF%E7%94%A8+jQueryUI+%E7%9A%84+DatePicker
http://www.fbloggs.com/2009/04/16/how-to-style-the-button-image-in-jquery-datehandler-ui/
http://jqueryui.com/datepicker/#localization
http://blog.wu-boy.com/2008/04/jquery%E7%AD%86%E8%A8%98-%E5%A5%BD%E7%94%A8%E7%9A%84%E6%97%A5%E6%9C%9F%E5%87%BD%E5%BC%8F/
script取得ID的方式
一、
$(".date-picker").datepicker()
二、
$("#<%= txtEventDate.ClientID %>").datepicker()
三、$("input[id*=txtEventDate]").datepicker()
參考資料:http://stackoverflow.com/questions/5115067/jquery-datepicker-not-working-in-asp-net-page
0 意見: