2013-12-16 103 views
1

我在我的asp.net窗體應用程序中使用bootstrap。我在這個項目所需的所有文件:引導與asp.net形式

  • bootstrap.min.js
  • jQuery的2.0.3.min.js
  • bootstrap.min.css

當我添加一個內容頁面在根目錄下,該網站工作完美;所有的引導功能都能正常工作。但問題是,當我將內容放入另一個文件夾(例如webapp/content/default.aspx)時,該網站在IE中不起作用。在其他瀏覽器上顯示內容,但引導程序的功能根本不起作用。

我的腳本:

<script src="js/jquery-2.0.3.min.js"></script> 
<script src="js/bootstrap.min.js"></script> 
</body> 

回答

0

你需要一個/ 在

<script src="/js/jquery-2.0.3.min.js"></script> 
<script src="/js/bootstrap.min.js"></script> 

更完整

  1. 開始以斜線使它相對於網站的根目錄
  2. 兩個句點../會讓你走p一個目錄(所以../../使它上升到兩個目錄...)
  3. 〜/帶你到你的項目目錄的根目錄。
  4. 否則它是相對於目錄中的當前文件中。(所以JS/jQuery的2.0.3.min.js正在尋找在你的當前目錄的子文件夾的js文件。)
0
**Try using the files:** 
ie8-responsive-file-warning.js, 
html5shiv.js and 
respond.min.js. 

Make the Downloads and place the files in js folder. 

**Use the paths** 

    "@Url.Content("~/patch/file.js")" 



    ****Example**** 


    <head> 
     <!-- Just for debugging purposes. Don't actually copy this line! --> 
     <!--[if lt IE 9]><script src="@Url.Content("~/js/ie8-responsive-file-warning.js")"></script><![endif]--> 

     <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> 
     <!--[if lt IE 9]> 
      <script src="@Url.Content("~/js/html5shiv.js")"></script> 
      <script src="@Url.Content("~/js/respond.min.js")"></script> 
     <![endif]--> 

     <script src="@Url.Content("~/js/jquery-2.0.3.min.js")"></script> 
     <script src="@Url.Content("~/js/bootstrap.min.js")"></script> 

     </head>