A
A
asdz2014-09-23 13:04:27
Django
asdz, 2014-09-23 13:04:27

How to correctly add a resource from a scope to a bundle in an ASP NET MVC project?

Inside the area I create a BundleConfig in which I want to form a package from the styles used in the views inside the area:
Folder structure:
Areas
........Admin
................Content
... .................css
................Controllers
........... .....Views
Content
........css
...
BundleConfig area:

internal static class BundleConfig
    {
        internal static void RegisterBundles(BundleCollection bundles)
        {
            bundles.Add(new StyleBundle("~/Admin/css").Include(
                      "~/Content/css/bootstrap.min.css"));
        }
    }

with this formation of the package, the files are taken from the root folder Content/css, but it is necessary from Areas/Admin/Content/css. What is the correct way to include style files in a package? Thus?
bundles.Add(new StyleBundle("~/Admin/css").Include(
                      "~/Areas/Admin/Content/css/bootstrap.min.css"));

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2016-09-26
@dmtrrr

PYTHONPATH

H
Hrabry, 2016-09-26
@Hrabry

Judging by the attached screenshot, your urls.py file you refer to is located in the trydjango19 folder, from here it will be correct:
ROOT_URLCONF='trydjango19.urls'
Or rename the trydjango19 folder to trydjango.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question