AspNetCore.Docs/aspnetcore/includes/bind-get.md

14 lines
851 B
Markdown
Raw Normal View History

---
no-loc: [Home, Privacy, Kestrel, appsettings.json, "ASP.NET Core Identity", cookie, Cookie, Blazor, "Blazor Server", "Blazor WebAssembly", "Identity", "Let's Encrypt", Razor, SignalR]
---
> [!WARNING]
2019-09-07 04:02:58 +08:00
> For security reasons, you must opt in to binding `GET` request data to page model properties. Verify user input before mapping it to properties. Opting into `GET` binding is useful when addressing scenarios that rely on query string or route values.
>
2019-12-06 07:12:26 +08:00
> To bind a property on `GET` requests, set the [`[BindProperty]`](xref:Microsoft.AspNetCore.Mvc.BindPropertyAttribute) attribute's `SupportsGet` property to `true`:
>
2019-09-07 04:02:58 +08:00
> ```csharp
> [BindProperty(SupportsGet = true)]
> ```
>
2019-09-07 04:02:58 +08:00
> For more information, see [ASP.NET Core Community Standup: Bind on GET discussion (YouTube)](https://www.youtube.com/watch?v=p7iHB9V-KVU&feature=youtu.be&t=54m27s).