ASP.NET Core Razor Pages in Action
- Length: 456 pages
- Edition: 1
- Language: English
- Publisher: Manning
- Publication Date: 2022-12-27
- ISBN-10: 1617299987
- ISBN-13: 9781617299988
- Sales Rank: #281972 (See Top 100 Books)
Razor Pages lets you build, configure, and deploy amazing dynamic ASP.NET websites with ease.
Razor Pages lets you build, configure, and deploy amazing dynamic ASP.NET websites with ease. In ASP.NET Core Razor Pages in Action, you’ll use Razor Pages to build a complete application, learning to iterate amazing new features chapter-by-chapter.
In ASP.NET Core Razor Pages in Action, you’ll go hands-on to build a complete vacation-booking application, incorporating new framework features and adding complexities as they’re introduced. You’ll see how Razor Pages simplifies all the essential tasks of web development, how to enhance your web applications with the huge ecosystem of C# libraries, and how to locate the perfect tool for your task using centralized repositories.
Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.
inside front cover ASP.NET Core Razor Pages in Action Copyright contents front matter preface acknowledgments about this book Who should read this book How this book is organized About the code liveBook discussion forum about the author about the cover illustration 1 Getting started with Razor Pages 1.1 What is Razor Pages? 1.1.1 Web development frameworks 1.1.2 Server-side frameworks 1.1.3 Cross-platform functionality 1.1.4 Open source 1.1.5 Using your existing knowledge 1.2 What can you do with Razor Pages? 1.3 The technologies that underpin Razor Pages 1.3.1 The ASP.NET Core MVC framework 1.3.2 Model-view-controller 1.3.3 The design goals of Razor Pages 1.4 When should you use Razor Pages? 1.5 Working with Razor Pages 1.5.1 How do you get Razor Pages? 1.5.2 Choosing a development environment 1.5.3 Choosing a database system Summary 2 Building your first application 2.1 Creating your first website 2.1.1 Creating a website using Visual Studio 2.1.2 Creating a website using the command-line interface 2.1.3 Running the application 2.1.4 Adding a new page 2.1.5 Modifying to include dynamic content 2.1.6 Adding the page to the navigation 2.2 Exploring the project files 2.2.1 The WebApplication1.sln file 2.2.2 The WebApplication1.csproj file 2.2.3 The bin and obj folders 2.2.4 The Properties folder 2.2.5 The wwwroot folder 2.2.6 The Pages folder 2.2.7 The app-settings files 2.2.8 Program.cs 2.3 Understanding middleware 2.3.1 An HTTP refresher 2.3.2 The HttpContext 2.3.3 The application request pipeline 2.3.4 Creating middleware 2.3.5 Middleware classes Summary 3 Working with Razor Pages 3.1 Working with Razor syntax 3.1.1 Directives and code blocks 3.1.2 Rendering HTML with expressions 3.1.3 Control blocks in Razor 3.1.4 Rendering literal strings 3.1.5 Rendering literal HTML 3.2 Layout pages 3.2.1 Assigning the Layout property 3.2.2 Injecting optional content with sections 3.3 Reusable HTML with partial views, tag helpers, and view components 3.3.1 Partial views 3.3.2 Tag helpers 3.3.3 View components 3.4 The PageModel 3.4.1 Passing data to pages 3.4.2 The PageModel as a view model 3.4.3 The PageModel as a controller Summary 4 Matching URLs to Razor Pages with routing 4.1 Routing basics 4.1.1 Route templates 4.2 Customizing route templates 4.2.1 Overriding routes 4.2.2 Route parameters 4.2.3 Binding route data to handler parameters 4.2.4 Catchall parameters 4.2.5 Route constraints 4.2.6 Creating additional routes 4.2.7 Working with PageRouteModel conventions directly 4.3 Generating URLs 4.3.1 The anchor tag helper 4.3.2 Using the IUrlHelper to generate URLs 4.3.3 Generating redirect URLs from ActionResults 4.3.4 Customizing URL generation 4.3.5 Using parameter transformers to customize route and parameter value generation Summary 5 Working with forms: Model binding 5.1 Forms basics 5.1.1 Using the post-redirect-get pattern 5.1.2 Accessing values from Request.Form 5.1.3 Accessing values from Request.Query 5.2 Model binding 5.2.1 Using model binding with handler parameters 5.2.2 Using model binding with public properties 5.2.3 Binding complex objects 5.2.4 Binding simple collections 5.2.5 Binding complex collections 5.3 Validating user input in Razor Pages 5.3.1 DataAnnotation attributes 5.3.2 Client-side validation 5.3.3 Server-side validation 5.3.4 Managing more complex validation with ModelState 5.3.5 Custom validation attributes Summary 6 Working with forms: Tag helpers 6.1 The form and form action tag helpers 6.2 Input and label tag helpers 6.2.1 Understanding the input types 6.2.2 Using data annotation attributes to control presentation 6.2.3 Formatting the rendered date or time value 6.2.4 Using the DisplayAttribute to control labels 6.3 The select tag helper 6.3.1 Creating options 6.3.2 Binding multiple values 6.3.3 Working with OptGroups 6.3.4 Binding enumerations 6.4 Check boxes and radio controls 6.5 Uploading files Summary 7 Using dependency injection to manage services 7.1 The reason for dependency injection 7.1.1 Single-responsibility principle 7.1.2 Loose coupling 7.1.3 Dependency inversion 7.1.4 Dependency injection 7.2 Inversion of control containers 7.2.1 Service registration 7.2.2 Service lifetimes 7.2.3 Captive dependencies 7.2.4 Other service registration options 7.2.5 Registering multiple implementations 7.3 Other ways to access registered services 7.3.1 View injection 7.3.2 Method injection 7.3.3 Directly from the service container with GetService and GetRequiredService Summary 8 Working with data 8.1 What is Entity Framework Core? 8.1.1 Why choose EF Core? 8.1.2 How does EF Core work? 8.1.3 Managing relationships 8.1.4 Installing Entity Framework Core 8.1.5 Create the context 8.1.6 Adding DbSets 8.1.7 Configuring the model 8.2 Migrations 8.2.1 Seed data 8.2.2 Adding migration tools 8.2.3 Creating and applying a migration 8.3 Querying data 8.3.1 Retrieving multiple records 8.3.2 Selecting single records 8.4 Scaffolding CRUD pages 8.4.1 Visual Studio scaffold instructions 8.4.2 Scaffolding from the command line 8.4.3 Working with the scaffolded pages 8.5 Creating, modifying, and deleting data 8.5.1 Modifying data 8.5.2 Deleting data Summary 9 Managing users with authentication 9.1 Authentication basics 9.1.1 How authentication works 9.1.2 Adding simple authentication 9.2 ASP.NET Core Identity 9.2.1 Creating a user 9.2.2 Configuring the DbContext 9.2.3 Adding migration 9.3 Customizing Identity 9.3.1 Customizing Identity options 9.3.2 Customizing the user 9.3.3 Scaffolding and customizing the UI 9.3.4 Enabling email confirmation 9.3.5 Disabling UI features Summary 10 Controlling access with authorization 10.1 Basic authorization in Razor Pages 10.1.1 Applying simple authorization 10.1.2 Allowing anonymous access 10.2 Working with roles 10.2.1 Viewing roles 10.2.2 Adding roles 10.2.3 Assigning roles to users 10.2.4 Using policies to apply role checks 10.3 Claims-based authorization 10.3.1 Adding claims to users 10.3.2 Using policies to enforce claims-based authorization 10.3.3 Using assertions for more complex requirements 10.3.4 Custom authorization requirements and handlers 10.3.5 Roles or claims? 10.4 Authorizing resources 10.4.1 Creating a requirement and a handler 10.4.2 Applying authorization to the UI Summary 11 Client-side technologies and AJAX 11.1 Choosing your client-side technology 11.2 Calling page handlers from JavaScript 11.2.1 Using a partial page to return HTML 11.2.2 Posting to a page handler 11.2.3 Working with JsonResult 11.3 Minimal request-handling APIs 11.3.1 An example minimal API 11.3.2 Parameters in minimal APIs 11.3.3 Minimal API return types 11.4 CSS Isolation in Razor Pages Summary 12 Troubleshooting your application 12.1 Exception management 12.1.1 The Developer Exception page 12.1.2 ExceptionHandlerMiddleware 12.2 StatusCodePages 12.2.1 Exploring WithRedirects 12.2.2 StatusCodePages WithReExecute 12.3 Logging 12.3.1 Logging basics 12.3.2 Log levels 12.3.3 Log categories 12.3.4 Using EventIds 12.3.5 Formatting the log message 12.3.6 Applying log filter rules 12.3.7 Custom email logger 12.3.8 Structured logging with Serilog Summary 13 Protecting your application against external attacks 13.1 HTTPS 13.1.1 SSL/TLS certificates 13.1.2 Using HTTPS in development 13.1.3 Including HSTS in production 13.2 Broken access control 13.2.1 Incorrect security policies 13.2.2 Cross-site request forgery 13.3 Cryptographic failures 13.3.1 Plain-text passwords 13.3.2 Using the PasswordHasher without Identity UI 13.4 Injection attacks 13.4.1 SQL injection 13.4.2 Cross-site scripting Summary 14 Configuring and publishing your application 14.1 Working with environments 14.1.1 Understanding and managing environments 14.1.2 Setting the environment 14.1.3 Registering services conditionally for each environment 14.1.4 The IHostEnvironment service 14.1.5 The environment tag helper 14.2 Application configuration 14.2.1 appSettings.json 14.2.2 Accessing configuration settings programmatically by key 14.2.3 Strongly typed app settings 14.2.4 Using the options pattern 14.2.5 Binding directly to POCOs 14.2.6 Environments 14.3 Improving performance with caching 14.3.1 The cache tag helper 14.3.2 In-memory caching with IMemoryCache 14.4 Publishing your application 14.4.1 Self-contained and framework-dependent 14.4.2 Publishing using the CLI 14.4.3 Publishing using Visual Studio Summary index
Donate to keep this site alive
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.