SupportsGet is a BindProperty setting that opts a Razor Pages property into model binding for HTTP GET requests. Without it, [BindProperty] properties are not populated during GET requests. section 15.3 section 16.2
Bind a query value during GET
Decorate the property with [BindProperty(SupportsGet = true)]. In the example, a GET request can populate Username, while Category remains unbound because it uses ordinary [BindProperty]. The OnGet handler can then use the populated property. section 15.6
Keep these model-binding details in mind:
- Treat GET binding as an explicit opt-in; binding is restricted by default for security reasons. section 16.2
- Give the bound property a public setter, or model binding silently fails. section 16.2
- Use SupportsGet for request values supplied through model binding, while handler parameters remain another way to receive request values. section 15.3
