簡體   English   中英

使用引導程序時沖突的母版頁和內容頁

[英]conflicting master and content page while using bootstrap

我在asp.net C#中使用“母版和內容”頁面

如果我嘗試解決上述錯誤,則母版頁中的下拉列表會產生錯誤,因為Uncaught TypeError:$(...)。dropdown不是一個函數

Uncaught TypeError: $(...).datepicker is not a function (anonymous function) @ com_mst_CompanyRegistrationAdd.aspx:111 i @ jquery.min.js:2 fireWith @ jquery.min.js:2 ready @ jquery.min.js:2 K @ jquery.min.js:2

在母版頁中:

<script src="../Scripts/jquery-1.12.4.js"></script>
    <script src="../Scripts/jquery-1.12.4.min.js"></script>    
    <script src="../Scripts/bootstrap.js"></script>
    <script src="../Scripts/bootstrap.min.js"></script>
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
    <script>
$(document).ready(function() {
    $('dropdown-toggle').dropdown()
});
</script>

在內容頁面中:

 <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

    <script type="text/javascript">
        $(function () {
            $("#txtEstablishedDate").datepicker({
                dateFormat: "dd/mm/yy",
                changeMonth: true,
                changeYear: true,               
                });
        });
    </script>
    <script type="text/javascript">
        $(function () {

            $("#txtRCDate").datepicker({
                dateFormat: "dd/mm/yy",
                changeMonth: true,
                changeYear: true
            });
        });
    </script>
    <script type="text/javascript">
        $(function () {
            $("#txtCstDate").datepicker({
                dateFormat: "dd/mm/yy",
                changeMonth: true,
                changeYear: true
            });
        });

    </script>

請幫助我找出錯誤..

未捕獲的類型錯誤。我認為您正在使用Jquery UI小部件。 您需要粘貼以下腳本並在下面鏈接網址。

 <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

這將解決問題

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM