Here we go again.. This is how you disable it in Rider: File > Settings > Editor > Color Scheme > ASP.NET Drop down the Razor list and choose Code Block. Uncheck the background color to the right. Tuh-dah! This was default on the VS Dark Theme for Rider. I’m not sure about others.
Here’s how you can fix it Change it back to C# code: in VS2019 click Tools>Options>Environment>Fonts and Colors>HTML Razor Code Background.
On the right side, you can select another Item background. You can select another background that uses your default color and save it as a custom color then go back to select it.
Use code-behind! You can add a standard C# class as a partial class in the same parent as the Blazor Page and name it PageName....