liveBook · Manning

BindProperty attribute

The BindProperty attribute is an ASP.NET Core attribute that enables binding a Razor PageModel property from incoming request data.

How 2 Manning books explain it

ASP.NET Core in Action, 3e

The BindProperty attribute marks a Razor PageModel property for binding from incoming request data.

How it is used
Binds request data to selected Razor PageModel properties for use by page handlers.
How deep it goes
Explains GET opt-in, binding sources, type requirements, validation, and input-model organization with PageModel examples.
Examples
Uses category and username filters, a nested InputModel, and an edit-product form to illustrate bound properties.
What you can do after
Apply it via ASP.NET Core Razor Pages to bind selected properties, opt into GET binding, and check validation results.

Read how ASP.NET Core in Action, 3e explains BindProperty attribute →

Pro ASP.NET Core 7, Tenth Edition

The BindProperty attribute is an ASP.NET Core attribute that marks a page-model property for binding from request data.

How it is used
Populates Razor Page properties from request data so handlers can use them without duplicate parameters.
How deep it goes
Explains name matching, GET opt-in, prefixes, complex properties, and arrays through form examples; does not detail binder internals.
Examples
Uses a completed-order identifier, a product form, and repeated or indexed inputs for an array.
What you can do after
Apply it in Razor Pages to bind properties from forms or GET requests and adjust names for nested or array values.

Read how Pro ASP.NET Core 7, Tenth Edition explains BindProperty attribute →

What to know first

Related concepts

Questions about BindProperty attribute

What is BindProperty attribute?

The BindProperty attribute is an ASP.NET Core attribute that enables binding a Razor PageModel property from incoming request data.

Which Manning books explain BindProperty attribute?

ASP.NET Core in Action, 3e and Pro ASP.NET Core 7, Tenth Edition.

What should I know before learning BindProperty attribute?

Manning books that teach BindProperty attribute usually introduce PageModel first.

What is the difference between BindProperty attribute and BindProperties?

The BindProperty attribute is an ASP.NET Core attribute that enables binding a Razor PageModel property from incoming request data. BindProperties is an ASP.NET Core attribute that enables model binding for all public properties of an annotated class.

What are the parts of BindProperty attribute?

BindProperty attribute includes SupportsGet.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.