How to use Scoped CSS Styles with .CSHTML Razor Views in ASP.NET 6.0

How to use Scoped CSS Styles with .CSHTML Razor Views in ASP.NET 6.0

Warren Buckley

2 года назад

7,659 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@sergioteijido80
@sergioteijido80 - 27.01.2023 13:42

Thanks for the video. Your are linking a css stylesheet to the view, but I have multiple layouts and multiple views using each layout. What I would like to do is linking the stylesheet to the layout instead of the view. It doesn't work for me following your video. Linking to the view works good but linking to the layout doesn't. Any idea why? I guess it is possible because default layout has a default stylesheet linked. Thanks.

Ответить
@EminoMeneko
@EminoMeneko - 06.07.2022 19:05

Thank you for the video but I do not understand the point of this. Actually I find it annoying more than anything else.
This scope does not simply transfer to partial views. More accurately the attribute is not added to elements in partial views.
That quite a problem to me. Is there a way to pass the attribute inside partials ?

Ответить