Adding bundling to your Bootstrap projectBecause we created an empty A dịch - Adding bundling to your Bootstrap projectBecause we created an empty A Việt làm thế nào để nói

Adding bundling to your Bootstrap p

Adding bundling to your Bootstrap project
Because we created an empty ASP.NET MVC site, the necessaryreference for
adding bundling was not automatically added to our project. Luckily, this can
easily be added by using the NuGet Package Manager Consoleas follows:
1. Open the Package Manager Consolewindow and enter the
following command:
install-package Microsoft.AspNet.Web.Optimization
2. This will install the Microsoft.AspNet.Web.OptimizationNuGet
package as well as all the packages it has dependencies on. These
dependencies are as follows:
° Microsoft.Web.Infrastructure
° WebGrease
° Antlr
° Newtonsoft.Json
3. After the NuGet packages have been installed successfully, create a
new static class called BundleConfiginside the App_Startfolder.
4. Inside this class, we'll create a new static method called RegisterBundles,
which accepts a parameter called bundles, whose type is a
BundleCollectionobject. The code for the class is as follows:
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bootstrap/js").Include(
"~/js/bootstrap.js",
"~/js/site.js"));
bundles.Add(new StyleBundle("~/bootstrap/css").Include(
"~/css/bootstrap.css",
"~/css/site.css"));
}
}
Bundles come in the following two types:
° ScriptBundle
° StyleBundle
0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
Adding bundling to your Bootstrap projectBecause we created an empty ASP.NET MVC site, the necessaryreference for adding bundling was not automatically added to our project. Luckily, this can easily be added by using the NuGet Package Manager Consoleas follows:1. Open the Package Manager Consolewindow and enter the following command:install-package Microsoft.AspNet.Web.Optimization2. This will install the Microsoft.AspNet.Web.OptimizationNuGet package as well as all the packages it has dependencies on. These dependencies are as follows:° Microsoft.Web.Infrastructure° WebGrease° Antlr° Newtonsoft.Json3. After the NuGet packages have been installed successfully, create a new static class called BundleConfiginside the App_Startfolder.4. Inside this class, we'll create a new static method called RegisterBundles, which accepts a parameter called bundles, whose type is a BundleCollectionobject. The code for the class is as follows:public class BundleConfig{public static void RegisterBundles(BundleCollection bundles){bundles.Add(new ScriptBundle("~/bootstrap/js").Include("~/js/bootstrap.js","~/js/site.js"));bundles.Add(new StyleBundle("~/bootstrap/css").Include("~/css/bootstrap.css","~/css/site.css"));}}Bundles come in the following two types:° ScriptBundle° StyleBundle
đang được dịch, vui lòng đợi..
Kết quả (Việt) 2:[Sao chép]
Sao chép!
Thêm bundling cho dự án Bootstrap của bạn
Bởi vì chúng tôi tạo ra một trang web ASP.NET MVC trống, necessaryreference cho
thêm bundling không tự động được thêm vào dự án của chúng tôi. May mắn thay, điều này có thể
dễ dàng được thêm bằng NuGet Package Manager Consoleas sau:
1. Mở Package Manager Consolewindow và nhập vào
lệnh sau:
cài đặt gói Microsoft.AspNet.Web.Optimization
2. Điều này sẽ cài đặt các Microsoft.AspNet.Web.OptimizationNuGet
gói cũng như tất cả các gói nó có phụ thuộc vào. Những
phụ thuộc như sau:
° Microsoft.Web.Infrastructure
° WebGrease
° ANTLR
° Newtonsoft.Json
3. Sau khi các gói NuGet đã được cài đặt thành công, tạo ra một
lớp tĩnh mới gọi là BundleConfiginside các App_Startfolder.
4. Bên trong lớp này, chúng tôi sẽ tạo ra một phương pháp tĩnh mới gọi là RegisterBundles,
mà chấp nhận một tham số gọi là bó, có loại là một
BundleCollectionobject. Các mã cho các lớp như sau:
public class BundleConfig
{
public static RegisterBundles void (BundleCollection bó)
{
bundles.Add (ScriptBundle mới ("~ / bootstrap / js") Bao gồm (.
"~ / js / bootstrap.js",
"~ / js / site.js"));
. bundles.Add (StyleBundle mới ("~ / bootstrap / css") Bao gồm (
"~ / css / bootstrap.css",
"~ / css / site.css") );
}
}
Gói đến trong hai loại sau:
° ScriptBundle
° StyleBundle
đang được dịch, vui lòng đợi..
 
Các ngôn ngữ khác
Hỗ trợ công cụ dịch thuật: Albania, Amharic, Anh, Armenia, Azerbaijan, Ba Lan, Ba Tư, Bantu, Basque, Belarus, Bengal, Bosnia, Bulgaria, Bồ Đào Nha, Catalan, Cebuano, Chichewa, Corsi, Creole (Haiti), Croatia, Do Thái, Estonia, Filipino, Frisia, Gael Scotland, Galicia, George, Gujarat, Hausa, Hawaii, Hindi, Hmong, Hungary, Hy Lạp, Hà Lan, Hà Lan (Nam Phi), Hàn, Iceland, Igbo, Ireland, Java, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Kurd, Kyrgyz, Latinh, Latvia, Litva, Luxembourg, Lào, Macedonia, Malagasy, Malayalam, Malta, Maori, Marathi, Myanmar, Mã Lai, Mông Cổ, Na Uy, Nepal, Nga, Nhật, Odia (Oriya), Pashto, Pháp, Phát hiện ngôn ngữ, Phần Lan, Punjab, Quốc tế ngữ, Rumani, Samoa, Serbia, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenia, Somali, Sunda, Swahili, Séc, Tajik, Tamil, Tatar, Telugu, Thái, Thổ Nhĩ Kỳ, Thụy Điển, Tiếng Indonesia, Tiếng Ý, Trung, Trung (Phồn thể), Turkmen, Tây Ban Nha, Ukraina, Urdu, Uyghur, Uzbek, Việt, Xứ Wales, Yiddish, Yoruba, Zulu, Đan Mạch, Đức, Ả Rập, dịch ngôn ngữ.

Copyright ©2025 I Love Translation. All reserved.

E-mail: