Bootstrap Datetimepicker不与母版页一起使用

时间:2018-05-06 19:52:57

标签: css asp.net bootstrap-datetimepicker

我正在使用bootstrap制作表单。我无法在我的项目中使用bootstrap datetimepicker。掌握页面可能有问题吗?

请帮帮我。

Jquery和Sheets:

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js"></script>   

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"/>



<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/css/bootstrap-datetimepicker.min.css" />

        <script type="text/javascript">
            $(document).ready(function() {
                $(function () {
                    $("#dp").click(function () {
                        $('#datetimepicker1').datetimepicker();
                    })
                })
            });
        </script>

ASPX代码:

                                        <div class="col-md-3">
                                            <div class="form-group">
                                            <div class='input-group date' id='datetimepicker2'>
                                                <input type='text' class="form-control" />
                                                <span id="dp" class="input-group-addon">
                                                    <span class="glyphicon glyphicon-calendar"></span>
                                                </span>
                                            </div>
                                        </div>

                                        </div>

1 个答案:

答案 0 :(得分:0)

使用var date_input = $('#<%= date.ClientID%>');并将clientmodeid设置为static。