-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
✔️ Resolution: DuplicateResolved as a duplicate of another issueResolved as a duplicate of another issueStatus: Resolvedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
In Blazor server the @page only accepts a string with double quotes.
We can't use @page MyRoutes.ModuleA
or @page $"{MyRoutes.Base}\{MyRoutes.ModuleB}"
Expected Behavior
Should be possible to use const string routes defined in a static class:
@page MyRoutes.ModuleA`
@page $"{MyRoutes.Base}\{MyRoutes.ModuleB}"
Steps To Reproduce
@page RouteHelper.Foo
internal static class RouteHelper {
public const string Foo = "foo/bar";
}
Exceptions (if any)
RZ1016 The 'page' directive expects a string surrounded by double quotes.
.NET Version
6.0.401
Anything else?
Blazor Server
Visual Studio 2022
Metadata
Metadata
Assignees
Labels
✔️ Resolution: DuplicateResolved as a duplicate of another issueResolved as a duplicate of another issueStatus: Resolvedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components