MVC 捆绑外部链接

问题描述

如何保存此链接中的任何内容并将其用于我的 MVC 捆绑

<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.2/themes/blitzer/jquery-ui.css">



  public static void RegisterBundles(BundleCollection bundles)
        {
            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/jquery-{version}.js","~/Scripts/jquery-ui-{version}.js")); 

}

解决方法

如果你有这样的链接

<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.2/themes/blitzer/jquery-ui.css">

然后去https://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.2/themes/blitzer/jquery-ui.css

 1) Right click the page then Save As - it should be a .cs file
    
 2)After saving it,just copy it to your MVC Project inside Content folder.

 3) Bundle it  
bundles.Add(new StyleBundle("~/Content/css").Include(
                      "~/Content/bootstrap.css","~/Content/site.css","~/Content/blitzer.css")); 
      //This is what I added,I named my file blitzer when saving it 
        }