liveBook · Manning

User binding model

As explained in ASP.NET Core in Action, 3e

A user binding model is an application-defined binding model containing user-related request data for a specific form or handler.

A user binding model is an application-defined class that groups user details for a specific form or handler. In a Razor Page, expose it through a bindable PageModel property so request data and form fields share one shape. section 18.2

A practical checkout model can provide:

  • DataAnnotations for required values, length limits, display labels, email validation, and phone validation. section 18.2

How ASP.NET Core in Action, 3e covers it

How deep it goes
Defines properties, validation annotations, binding exposure, and generated HTML, while deferring broader security treatment.
Examples
Uses a checkout model containing names, email, phone number, validation annotations, and generated form HTML.
What it assumes
Assumes model binding and DataAnnotations validation, then applies their metadata to generated form controls.
What you can do after
Build it from scratch as a validated checkout form model bound to a Razor Page.
How it connects
Connects model binding, DataAnnotations, model validation, Razor Pages, Tag Helpers, and mass-assignment attacks.

This explainer was generated by Manning's knowledge graph from the text of ASP.NET Core in Action, 3e. The section links point to the parts of the book it draws on.