Razor Page scaffolder should add `@page "{id:int}"` directive
See original GitHub issueThe RP scaffolder should add @page “{id:int}” directive so generated links pass the ID as route data, not query strings.
All my RP tutorials I have to have a section on adding this. See https://docs.microsoft.com/en-us/aspnet/core/tutorials/razor-pages/da1
Update the Edit, Details, and Delete Razor Pages to use the "{id:int}"
route template. Change the page directive for each of these pages to @page "{id:int}"
I have to do the same thing in my RP/EF tutorial.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Part 3, scaffolded Razor Pages in ASP.NET Core
This tutorial examines the Razor Pages created by scaffolding in the previous ... @page must be the first Razor directive on a page....
Read more >Getting Started with Razor Pages: A Better Model for Web ...
The page directive is required. The model directive should refer to the class but, for the first Razor Page you add, there won't...
Read more >Scaffold Identity in ASP.NET Core projects
Applications that include Identity can apply the scaffolder to selectively add the source code contained in the Identity Razor Class Library ( ...
Read more >Customising the ASP.NET Core default UI without editing ...
I show how you can use the ASP.NET Core Identity scaffolder to generate the replacement Razor Pages initially, but customise these to use ......
Read more >Strongly typed route in @page directive in Razor Pages
The @page directive expects a string and would throw an exception for a variable. The RouteAttribute is simply ignored. There is a way...
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
Sounds reasonable to me.
Sure. Will close this since it is a feature request on all generated content and not specific to scaffolding.