OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.38k stars 1.12k forks source link

css, script File not found error #7487

Closed krishgop closed 7 years ago

krishgop commented 7 years ago

AM developing new Theme based on Gentelella html layout how to place url for CSS, script files.

here i have placed the following type

<script type="text/javascript" src="@Href("~/Themes/Gentelella/Assests/Chart.js/dist/Chart.min.js")">

<script src="@Href("~/Themes/Gentelella/Assests/Chart.js/dist/Chart.min.js")">

<script src="@Href("~/Themes/Gentelella/Assests/gauge.js/dist/gauge.min.js")">

<script src="@Href("~/Themes/Gentelella/Assests/bootstrap-progressbar/bootstrap-progressbar.min.js")">

<script src="@Href("~/Themes/Gentelella/Assests/iCheck/icheck.min.js")">

<script src="@Href("~/Themes/Gentelella/Assests/skycons/skycons.js")">

<script src="@Href("~/Themes/Gentelella/Assests/Flot/jquery.flot.js")"> <script src="@Href("~/Themes/Gentelella/Assests/Flot/jquery.flot.pie.js")"> <script src="@Href("~/Themes/Gentelella/Assests/Flot/jquery.flot.time.js")"> <script src="@Href("~/Themes/Gentelella/Assests/Flot/jquery.flot.stack.js")"> <script src="@Href("~/Themes/Gentelella/Assests/Flot/jquery.flot.resize.js")">

<script src="@Href("~/Themes/Gentelella/Assests/flot.orderbars/js/jquery.flot.orderBars.js")"> <script src="@Href("~/Themes/Gentelella/Assests/flot-spline/js/jquery.flot.spline.min.js")"> <script src="@Href("~/Themes/Gentelella/Assests/flot.curvedlines/curvedLines.js")">

<script src="@Href("~/Themes/Gentelella/Assests/DateJS/build/date.js")">

<script src="@Href("~/Themes/Gentelella/Assests/jqvmap/dist/jquery.vmap.js")"> <script src="@Href("~/Themes/Gentelella/Assests/jqvmap/dist/maps/jquery.vmap.world.js")"> <script src="@Href("~/Themes/Gentelella/Assests/jqvmap/examples/js/jquery.vmap.sampledata.js")">

<script src="@Href("~/Themes/Gentelella/Assests/moment/min/moment.min.js")"> <script src="@Href("~/Themes/Gentelella/Assests/bootstrap-daterangepicker/daterangepicker.js")"> <script src="@Href("~/Themes/Gentelella/Scripts/custom.min.js")">

agriffard commented 7 years ago

Assests or Assets ?

Also, have you added a web.config like this in your Scripts and Assets folders to handle the static files ?

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.webServer>
        <staticContent>
            <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
        </staticContent>
        <handlers accessPolicy="Script,Read">
            <!-- For any request to a file exists on disk, return it via native http module. AccessPolicy="Script" above is to allow for a managed 404 page. -->
            <add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
        </handlers>
    </system.webServer>
</configuration>