2014-01-21 3 views
0

현재 mvc 4.0 및 IgniteUI를 사용하여 프로젝트를 만들고 있습니다. ignite의 모든 파일을 번들로 만들려고합니다 ... 그래서 웹 설정에서 설정했습니다. 파일이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이 경우,이를 넣어 0

내 파일 디렉토리는 다음과 같이이다 : 프로젝트

-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을 열려고 ... 그것은 나에게 내가 놓친 거지 어떤 오류 ... 을 준다? 페이지는 당신이 ASP로 jQuery를 UI를 누락 될 수 있습니다 생각 .. 사전에

감사합니다 ..

+3

오류가 정확히 무엇입니까? –

+0

실수로 죄송합니다. 에로를 추가했습니다. 페이지가 나타나지 않습니다. 화이버를 사용하여 파일이 전달되고 있는지 확인합니다 .. –

+0

소스보기로 이동하면 특정 파일을 볼 수 없습니다. 포함되지 않습니까? –

답변

0

을 파일을 볼 불을 지르고를 사용하여 ...하지만 쇼를 nthing하고있는 browser..i에 나타납니다 doenst. 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를 UI는 Ignite UI 스크립트보다 먼저로드해야합니다. Adding Required Resources docs과 거의 모든 sample에서 볼 수 있습니다. 따라서 시작할 때 참조로 사용하는 것이 좋습니다.

jQuery UI CSS ("~/Content/themes /"의 MVC4에 포함 된 기본 테마)를 모두 포함하여 Ignite UI theme CSS file is custom a jQuery UI theme도 필요하지 않습니다.

관련 문제