-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Consider aligning how the @page directive works in razor components with how it works in razor pages #8787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This makes a lot of sense, especially with razor components used within a razor pages web app. |
In my opinion, for a Blazor SPA routing should not require attributes at all. Also, if you want to provide re-usable components and pages for multiple applications under different routes (i.e. in a component or functionality library), the attribute approach is extremely inflexible as you can only have one definition on the attribute, and you need to copy & paste code or unnecessarily derive a new component from the shared one to provide different routes. It would be much better to have a configurable routing system which you set up in |
Default and optional route parameters would be useful. |
@danroth27 is this something we're still looking to pursue? If so, would this be a 7.0 planning candidate? |
I think it's worth trying to get to a consistent place with |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Hi. Thanks for contacting us. |
The fix for this is to align the behavior of the
@page
directive with the Razor Pages behaviour, with one addition. If your page is in the Pages folder then that segment will be ignored.If you don't like this, and you want direct control, you can use
@attribute [Route(....)]
The text was updated successfully, but these errors were encountered: