admin管理员组文章数量:1336139
I hope to have two different pages in the web app that use different style libraries, such as one using Bootstrap 3 and the other using Bootstrap 5
In .NET 7, two different implementations of _host.cshtml
can be used. However, in the .NET 8 web app, there is no longer a host.cshtml
file and it has been replaced by an app.razor
file.
May I ask how to fulfill my above requirements?
I hope to have two different pages in the web app that use different style libraries, such as one using Bootstrap 3 and the other using Bootstrap 5
In .NET 7, two different implementations of _host.cshtml
can be used. However, in the .NET 8 web app, there is no longer a host.cshtml
file and it has been replaced by an app.razor
file.
May I ask how to fulfill my above requirements?
Share Improve this question edited Nov 20, 2024 at 17:12 marc_s 756k184 gold badges1.4k silver badges1.5k bronze badges asked Nov 20, 2024 at 15:34 King LeeKing Lee 331 silver badge2 bronze badges1 Answer
Reset to default 0You may try
@if (somecondition)
{
<link rel="stylesheet" href="......."]
}
else
{
<link rel="stylesheet" href="......."]
}
.....
@code{
// condition based on httpcontext
[CascadingParameter]
HttpContext? context{ get; set; }
}
in app.razor
when you navigate to pages in diffent styles,you need a full-page reload
本文标签: NET 8 Blazor server web appuse different style librariesStack Overflow
版权声明:本文标题:.NET 8 Blazor server web app : use different style libraries - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742348675a2458043.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论