Html.AddCssFileParts

1 week ago
Hi,
I'm trying to add Html.AddCssFileParts in my plugin. But the stylesheet is not loaded.

@model Nop.Plugin."....".Models.PublicInfoModel
@{
    Layout = "";
    Html.AddCssFileParts(ResourceLocation.Head, "~/Plugins/"..."/style.css");
}

@if (!string.IsNullOrEmpty(Model.Text))
{
    <div class="mystyle">
        @T("Products.Text"): @Model.Text
    </div>
}

Can someone say why?

Best regards
1 week ago
Make sure 2 things

1. style.css file is copied into Nop.Web/Plugins/"..."/ directory.

2. If CSS bundling and minification is checked (Configuration > Settings > General settings), then CSS code of style.css file has to be well formatted.
1 week ago
It could be the cache issue too. Try clearing the browser cache or if the changes are not reflected only in production and CDN is used, you should try clearing the CDN's cache too.
1 week ago
mhsjaber wrote:
Make sure 2 things

1. style.css file is copied into Nop.Web/Plugins/"..."/ directory.

2. If CSS bundling and minification is checked (Configuration > Settings > General settings), then CSS code of style.css file has to be well formatted.


Thanks for the answer. The 2 point was the problem. After activation, it was OK.