33,272 questions
Best practices
0
votes
1
replies
62
views
Authentication flow between razor(.cshtml) and.jsx
I'm getting a 302 status code.
Upon investigation, I found that it is likely the login button doesn't send a request to the server at all, hence the status code.
Advice
0
votes
4
replies
105
views
Are handler methods technically optional in a Razor Pages PageModel?
I recently had to add some makeshift API endpoints to a Razor Pages app that I could call from any other page on the site using client-side JS. I found an article that achieved this by adding a new ...
Score of 0
0 answers
105 views
Is this a Visual Studio bug?
I'm using Windows 11 Pro and Visual Studio Community 18.4.0.
Here is my simple Razor page:
@{
var str = "/*";
Console.WriteLine("Hello World"); // <-- place insertion ...
Score of 0
0 answers
60 views
.NET MAUI using RCL extra naming identifier on bundled css
I'm currently writing an app that has both a .NET MAUI app, plus a Blazor Web App for the front end, but both reference a Razor Class Library where all the actual pages are defined.
In the web app App....
Score of 2
2 answers
170 views
Why would the comment shortcut (Ctrl + /) not work when editing cshtml files in JetBrains Rider 2025.3.3?
On a Windows computer that has never had any JetBrains products installed, I installed Rider 2025.3.3.
The comment shortcut (Ctrl + /) works correctly in various file types (of relevance .cs, .js, ....
Advice
1
vote
7
replies
119
views
Best Practice passing object to component blazor
I need advice or an idea how this can be improved - what is the correct (or better) way to passing a large object?
I have a page called Tracker.razor. This page was specifically only for grabbing data ...
Score of 3
2 answers
159 views
Using @attribute [Authorize(Policy = "...")] throws IAuthenticationService error in Blazor Server app
I am trying to use policy-based authorization in a Blazor Server app using the Razor attribute:
@attribute [Authorize(Policy = "PolicyName")]
After adding app.UseAuthorization() and builder....
Score of 0
0 answers
119 views
JetBrains Rider does not recognize MudBlazor components imported via global:: in _Imports.razor (works in Visual Studio)
I am using JetBrains Rider 2025.3.2 on macOS with a MudBlazor project targetting .NET 8, C# 12. The project builds and runs correctly, and the same codebase works without any issues in Visual Studio, ...
Score of 2
2 answers
125 views
Why is the Client drop down list in my .razor file showing the integer value instead of the text value?
As mentioned in the subject line why is my Client drop down list in my razor .razor.cs file showing the value instead of the text? As you can see from the image below the Site drop down list is ...
Score of 1
1 answer
53 views
Generated Blazor components compile but render nothing when created by a Roslyn analyzer
I am generating Blazor components using a custom Roslyn analyzer.
The analyzer emits fully compiled Razor components (as C# classes that inherit from ComponentBase and implement BuildRenderTree).
The ...
Tooling
1
vote
2
replies
403
views
How to enable Razor/Blazor LSP support in Neovim using lazy.nvim?
I am currently using lazy.nvim to manage my plugins and csharp-language-server for C# development. While C# files work perfectly, I cannot get LSP features (completions, diagnostics, or go-to-...
Score of 0
0 answers
89 views
Simplest / lowest overhead method for including server generated variables in IIS webpages
This is possibly a dumb question.
I have a .NET 8 web application that is entirely service based; the pages themselves are pure static HTML, and all dynamic content of any kind is loaded via fetch ...
Tooling
1
vote
1
replies
123
views
C# style rules defined in .editorconfig are ignored in Razor code blocks
I am setting up an .editorconfig file to enforce certain conventions and code styles.
I have noticed that C# style rules only seem to apply to *.cs files and not Razor C# code blocks.
Take, as an ...
Score of 2
1 answer
104 views
ASP.NET Core MVC : get form text info to a controller
I'm trying to get a form to pass a person's name to a controller, and from there, display that person's LARP character info. Right now I'm only passing the character's name, class, species, and image ...
Score of 1
1 answer
90 views
How to fix 2sxc (v20.0.8) AppCode HotBuild compile error — AppCode.dll not generated
I'm having an issue when creating a new view in a 2sxc app (version 20.0.8).
Whenever 2sxc tries to generate the datamodels / compile the AppCode, the HotBuild process fails.
It looks like 2sxc is not ...