Skip to content

Automagical @page directive #14186

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

Closed
HughPH opened this issue Sep 20, 2019 · 2 comments
Closed

Automagical @page directive #14186

HughPH opened this issue Sep 20, 2019 · 2 comments
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one ✔️ Resolution: Duplicate Resolved as a duplicate of another issue

Comments

@HughPH
Copy link

HughPH commented Sep 20, 2019

Is your feature request related to a problem? Please describe.

Sometimes people forget to put @page on their pages, but this information can be derived from the pre-build directory structure anyway.

Describe the solution you'd like

Pre-build, .razor pages could have @page added to them, with the lowercase version of the filename without its extension. The path would come from the project's folders, and the root would be the location of the App.razor file.

For example, App.razor is in the razor folder. There are pages in pages and components folders under the razor folder. The Counter.razor file in the pages directory would automatically - if one has not been provided - get prepended with @page("/pages/counter") while the DataView.razor file in the components folder would be prepended with @page("/components/dataview")

@jbomhold3
Copy link

It would be nice to have a feature in Blazor and razor pages that created its routes based on namespace location and component name. Examples

Namespace Class Name Router output
Sample Index /index
Sample Login /login
Sample.Admin Users /admin/users
Sample.Admin UsersPage /admin/users
Sample.Admin.Users Manager /admin/users

@pranavkm pranavkm added the area-blazor Includes: Blazor, Razor Components label Sep 20, 2019
@mkArtakMSFT mkArtakMSFT added ✔️ Resolution: Duplicate Resolved as a duplicate of another issue enhancement This issue represents an ask for new feature or an enhancement to an existing one labels Sep 20, 2019
@mkArtakMSFT
Copy link
Member

Thanks for contacting us, @HughPH.
This is being tracked as part of #8787.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one ✔️ Resolution: Duplicate Resolved as a duplicate of another issue
Projects
None yet
Development

No branches or pull requests

4 participants