2014-01-21 4 views
0

В настоящее время я создаю проект с использованием mvc 4.0 и IgniteUI .. Я пытаюсь связать все файлы ignite ui ... , поэтому я установил в веб-конфигурации файл этогоAsp.net MVC 4 Объединение и определение каталогов

<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 ... он дает мне ошибку ... Что мне не хватает? страница doenst появляются на browser..i я использую поджигатель для просмотра файлов ... но Nthing шоу ..

Заранее спасибо ..

+3

Ошибка в том, что именно? –

+0

Извините за ошибку, я добавил erro к вопросу, страница не отображается, im использует firebug, чтобы проверить, не переданы ли файлы .. но ничего .. –

+0

Когда вы идете View Source, вы уверены, что файлы aren Не включается? –

ответ

0

Я думаю, что вы, возможно, отсутствует JQuery UI как ASP. NET MVC4 по умолчанию добавляет пакет jQuery. Правильный порядок необходимых ресурсов для Ignite UI будет выглядеть так:

In _Layout.cshtml: 
@Scripts.Render("~/bundles/jquery") 
@Scripts.Render("~/bundles/jqueryui") 
@RenderSection("scripts", required: false) 

, а затем либо непосредственно ниже, или в представлении, завернутые в разделе скриптов:

@section scripts{ 
    @Scripts.Render("~/bundles/jsFiles") 
    <!--Ignite UI related script(control definitions) go here--> 
} 

В основном, JQuery + JQuery Перед загрузкой пользовательского интерфейса Ignite необходимо загрузить пользовательский интерфейс. Вы можете видеть это в Adding Required Resources docs и почти любом sample, поэтому я предлагаю вам использовать их в качестве ссылки при запуске.

На стороне примечания, в том числе и jQuery UI CSS (базовая тема, включенная в MVC4 в «~/Content/themes /»), необязательна также как Ignite UI theme CSS file is custom a jQuery UI theme.