Join Jess Chadwick for an in-depth discussion in this video Handling HTTP verbs with custom logic, part of ASP.NET Core: Razor Pages.
- [Narrator] Now that I've created the HTML form…that allows users to post data, it's time to shift…focus back to the server and process that data.…When Visual Studio initially generated this page model,…it generated a class that was completely empty,…except for one method; a method named OnGet that…doesn't have a return value.…This is a clue to help you get started using…one of Razor Pages' most powerful features: the ability…to execute different code based on the…HTTP Verb that the request was made with.…
In other words, whenever this Razor Page is requested…through an HTTP Get request, like when you navigate…to the page in the browser, Razor Pages looks for…a method named OnGet and executes it…prior to rendering the Razor in the CSHTML page.…Likewise, when a Razor Page is requested with an HTTP Post…request, as is what happens during a form post,…Razor Pages looks for a method named OnPost and executes it…prior to rendering the page's markup.…
Since this page is going to be used to add and edit recipes,…it should first be able to load the data for an existing…
- Creating a new application
- Setting up pages
- Rendering dynamic content
- Reusing markup with layouts
- Increasing the maintainability of pages
- Processing data
- Validating input
- Securing an application
Skill Level Intermediate
Deploying ASP.NET Core Applicationswith Nate Barbettini57m 57s Intermediate
Building Web APIs with ASP.NET Corewith Chris Woodruff1h 7m Intermediate
ASP.NET Core: Test-Driven Developmentwith Richard Rout37m 30s Intermediate
1. Razor Pages Intro
What is Razor Pages?3m 5s
2. Razor Pages Basics
3. Reusing Markup with Layouts
4. Building Maintainable Applications
5. Working with Data
6. Validating User Inputs and Securing Your Application from Unauthorized Users
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.