BindProperties is an ASP.NET Core Razor Pages attribute applied to a PageModel. It makes every property on that PageModel participate in model binding, so request values can populate the model automatically. section 16.4 section 16.2
Use it cautiously: broad binding can accidentally include properties you did not intend to accept, increasing the risk of overposting and making the binding behavior less explicit. section 16.4 section 16.2
Prefer narrower alternatives when they fit the page:
- Apply BindProperty to one property, commonly an InputModel, when a form needs request values available to the Razor view. section 16.4 section 16.2
- Add simple values such as product IDs directly to page-handler parameters when the view does not need them afterward. section 16.4 section 16.2
- Validate bound user input before using it, regardless of which binding approach you choose. section 16.4
