我目前正在使用 mvc 4.0 和 IgniteUI 创建一个项目。我正在尝试捆绑 ignite ui 的所有文件...所以我在 web 配置文件中设置了这个
<system.web>
<compilation debug="false" targetFramework="4.0" />
我的 bundlesConfig.cs
using System.Web;
using System.Web.Optimization;
namespace LicenciamentoMVC
{
public class BundleConfig
{
// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
"~/Scripts/jquery-ui-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
"~/Scripts/jquery.unobtrusive*",
"~/Scripts/jquery.validate*"));
//BundleTable.EnableOptimizations = true;
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
//bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));
bundles.Add(new StyleBundle("~/Content/css").IncludeDirectory("~/Content/","*.css",true));
bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
"~/Content/themes/base/jquery.ui.core.css",
"~/Content/themes/base/jquery.ui.resizable.css",
"~/Content/themes/base/jquery.ui.selectable.css",
"~/Content/themes/base/jquery.ui.accordion.css",
"~/Content/themes/base/jquery.ui.autocomplete.css",
"~/Content/themes/base/jquery.ui.button.css",
"~/Content/themes/base/jquery.ui.dialog.css",
"~/Content/themes/base/jquery.ui.slider.css",
"~/Content/themes/base/jquery.ui.tabs.css",
"~/Content/themes/base/jquery.ui.datepicker.css",
"~/Content/themes/base/jquery.ui.progressbar.css",
"~/Content/themes/base/jquery.ui.theme.css"));
bundles.Add(new StyleBundle("~/bundles/cssFiles").IncludeDirectory("~/Content/CssIgniteUI/", "*.css", true));
bundles.Add(new ScriptBundle("~/bundles/jsFiles").IncludeDirectory("~/Scripts/js/", "*.js", true));
}
}
}
然后在我想要的视图中,在本例中为 index.cshtml
@{
ViewBag.Title = "Index";
}
@Styles.Render("~/bundles/cssFiles")
@Scripts.Render("~/bundles/jsFiles")
<h2>Index</h2>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
我的文件目录是这样的:项目
-Content
--CssIgniteUI(Css files of igniteui)
--themes(default theme css files of asp.net project)
--Site.css
-Scripts
--js(folder containing the js files from igniteui)
--all the files that come with the default theme of the project
当我尝试打开 Cliente Controler 时……它给了我错误……我错过了什么?该页面不会出现在浏览器上..我正在使用萤火虫查看文件...但是 nthing 显示..
提前致谢..