在 asp.net 中使用 Javascript 进行时间选择器控制

Using Javascript in asp.net for timepicker control

本文关键字:时间 选择器 控制 Javascript asp net      更新时间:2023-09-26

我正在尝试使用此TimePicker 控件 http://trentrichardson.com/examples/timepicker/但我是Web编程新手,所以我需要一点帮助,

到目前为止我有这个,但没有工作

<script src="../Scripts/jquery-ui-timepicker-addon.js"></script>
<link href="../Content/css/jquery-ui-timepicker-addon.css" rel="stylesheet" />    
<asp:UpdatePanel ID="upEdit" runat="server">
  <ContentTemplate>
    <div class="modal-body">
      <table class="table">
        <tr>
          <td><input type="text" name="basic_example" id="basic_example" class="hasDatepicker" >
            <script type="text/javascript">
              function timepic() {
                $('#basic_example').timepicker(
                  $.timepicker.regional['es'])
              };
            </script>
          </td>
        </tr>
      </table>
    </div>
  </ContentTemplate>
</asp:UpdatePanel>

我做错了什么?感谢您的帮助

将 javascript 函数更改为,

$(document).ready(function() {
    $('#basic_example').timepicker(
        $.timepicker.regional['es'])
});

将其添加到页面末尾。