Multiple @page on razor pages
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
Im trying to allow this
@page "/test/{id:int?}"
@page "/test/create"
this works with blazor but not works with RazorPages
Describe the solution you’d like
Same behaviour as Blazor @page
Additional context
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Is it possible to have multiple layout pages in a C# razor ...
Is there a way of using one layout file for some pages, and then a different layout files for other pages? ... This...
Read more >Introduction to Razor Pages in ASP.NET Core
Explains how Razor Pages in ASP.NET Core makes coding page-focused scenarios easier and more productive than using MVC.
Read more >Using Multiple Handler Methods in ASP.Net Core Razor ...
In this article I will explain with an example, how to use multiple Handler Methods inside Razor Pages in ASP.Net Core.
Read more >Handler Methods in Razor Pages
You might want to do this if your page features multiple forms, each one responsible for a different outcome, for example.
Read more >Handle multiple forms in asp net core razor pages - YouTube
NET Core Razor Pages Tutorial https://www.youtube.com/playlist?list=PL6n9fhu94yhX6J31qad0wSO1N_rgGbOPV Angular, JavaScript, jQuery, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@javiercn Thats not a bug for Blazor. Blazor is smart thing and i can use multiple @page for blazor. You can try it on any component. Ill try [HttpGet]. Can you also explain to me how i can use PageConvention to achive that? Im not using folders routing. Im using @page for routing.
@ParadiseFallen thanks for contacting us.
This is not something we plan to implement in the near future. You might be able to achieve this using
@attribute [HttpGet("...")]
or placing the route attribute on the model. You might also write your ownPageConvention
to decide how the route applies.I don’t believe you can put multiple
@page
directives in Blazor. That would be a bug