Load from within the partialview js / css

0

Good morning, insira o código aqui

I can not load .js / .css when loading partialview

no layout

<!DOCTYPE html>
<html>

<head>
    ...
    @RenderSection("header", required: false)
</head>

<body>
    ...
    @RenderSection("scripts", required: false)
</body>
</html>

in view index

@section header{
    @Styles.Render(...)<carrega de boa>
    @Scripts.Render(...)<carrega de boa>
}

@{
    ViewBag.Title = "Usuários";
}

<div class="row">
    @Html.Partial("~/Views/Cadastros/_ListaUsuarios.cshtml")

</div>

@section Scripts {
     ...
}

na partialview

@section header{
    @Scripts.Render("~/Content/plugins/datatables/js")  <<<<<<<<<<<<<<<<NÃO CARREGA>
}

<table id="#example" class="table-striped table-bordered tableHeader-skin-blue" style="width:100%">
    <thead>
        <tr>
            ....
        </tr>
    </thead>
    <tbody>
        ...
    </tbody>
</table>

I would like to know why the script I put in partialview is not being added to html?

Could anyone tell me?

    
asked by anonymous 04.11.2018 / 15:33

1 answer

0

Is your web.config allowing debugging?

 <system.web>
    <compilation debug="true|false" />

As you are only using a javascript file, it sometimes pays more to call it in the native method:

<script src="~/Content/plugins/datatables/arquivo_min.js"></script>

And you can centralize all your js and css files in the master page, or the parent page.

If it still does not work, run in Chrome from an F12 and see in the Console tab the errors of your page, you will probably be informing what the error is occurring.

Anything glues here the error for us.

    
05.11.2018 / 12:46