Why does my ASP.NET Core MVC application add some identifier to HTML elements?

29 views Asked by At

When running my new ASP.NET Core MVC application and viewing it in the browser, it seems ASP.NET Core added some kind of ID to some HTML elements.

I'm using .NET 6, and Razor .cshtml pages.

Why? And how to disable this?

Some kind of ID is added

1

There are 1 answers

0
Dimitris Maragkos On BEST ANSWER

It comes from Blazor CSS Isolation.

You can disable it by adding <ScopedCssEnabled>false</ScopedCssEnabled> to your app's project file (.csproj).

https://learn.microsoft.com/en-us/aspnet/core/blazor/components/css-isolation?view=aspnetcore-8.0#disable-css-isolation