原來專案的是bootstrap3的版本,有一些畫面想升級到bootstrap5
在載入js的 @Scripts.Render("~/bundles/bootstrap5") 出現 「並未將物件參考設定為物件的執行個體」。

解法  "new ScriptBundle" 改為 "new Bundle"

// 原來 bootstrap3 js 
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include("~/Scripts/bootstrap.min.js","~/Scripts/respond.min.js"));

// bootstrap5.1.3 js
bundles.Add(new Bundle("~/bundles/bootstrap5").Include("~/Scripts/bootstrap-5.1.3/bootstrap.bundle.min.js"));

 

 

 

arrow
arrow
    文章標籤
    mvc .net C#
    全站熱搜
    創作者介紹
    創作者 湯瑪的吳 的頭像
    湯瑪的吳

    安達利機車行

    湯瑪的吳 發表在 痞客邦 留言(0) 人氣()