Html.AddCssFileParts

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 年 前
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
4 年 前
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.
4 年 前
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.
4 年 前
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.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.