question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Razor Page scaffolder should add `@page "{id:int}"` directive

See original GitHub issue

The 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:closed
  • Created 6 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
danroth27commented, Jun 26, 2018

Sounds reasonable to me.

0reactions
vijayrkncommented, Nov 11, 2019

Sure. Will close this since it is a feature request on all generated content and not specific to scaffolding.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found