【问题标题】:Jquery datetimepicker() in ajax tabcontainerajax tabcontainer中的jquery datetimepicker()
【发布时间】:2013-03-15 09:59:33
【问题描述】:

我的 asp.net 页面中有 Ajax 选项卡容器。 我正在使用 jquery 通过单击文本框来选择日期。但是 jquery 在 Ajax 选项卡容器中不起作用。

下面是我正在使用的代码。

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" />
<script type="text/javascript">
               $(document).ready(function () {
            $(".datecontrol").datepicker();
        });

    </script>
 </script>
</head>
<body>
    <form id="form1" runat="server">
    <ajax:ToolkitScriptManager ID="scriptmanager1" runat="server">
    </ajax:ToolkitScriptManager>
    <div class="Wrapper">
        <ajax:TabContainer ID="TabContainer1" runat="server" CssClass="fancy fancy-green"
            ActiveTabIndex="0">
            <ajax:TabPanel ID="tbpnluser" runat="server">
                <HeaderTemplate>
                    New Patient</HeaderTemplate>
                <ContentTemplate>
                    <asp:Panel ID="UserReg" runat="server">
<asp:TextBox ID="txtDob" runat="server" CssClass="datecontrol"></asp:TextBox>
 </asp:Panel>
                </ContentTemplate>
            </ajax:TabPanel>
 </ajax:TabContainer>
 </div>
    </form>
</body>
</html>

【问题讨论】:

    标签: jquery asp.net ajax


    【解决方案1】:

    jQuery 不起作用,因为您没有在 HTML page 中包含 jQuery library

    在此处包含latest jquery library

    http://jquery.com/

    【讨论】:

      【解决方案2】:

      see here你需要导入以下文件。你只包含css文件而不是js文件。

      <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
        <script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
      

      【讨论】:

        【解决方案3】:

        您没有在脚本中包含文本框的 id..执行此操作..

        $(document).ready(function () {
                $("#txtDob").datepicker();
            });
        

        你也应该包括如下所示的jquery..

        <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
        

        有关更多信息,请参阅link

        【讨论】:

          猜你喜欢
          • 2012-04-13
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2014-02-16
          相关资源
          最近更新 更多