You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use dedicated controllers for mixed attributes (#18879)
* Use dedicated controllers for mixed attributes
* Update aspnetcore/security/authorization/simple.md
Co-authored-by: Pranav K <[email protected]>
Co-authored-by: Pranav K <[email protected]>
Copy file name to clipboardExpand all lines: aspnetcore/security/authorization/simple.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ This would allow only authenticated users to the `AccountController`, except for
73
73
74
74
## Authorize attribute and Razor Pages
75
75
76
-
The <xref:Microsoft.AspNetCore.Authorization.AuthorizeAttribute> can ***not*** be applied to Razor Page handlers. For example, `[Authorize]` can't be applied to `OnGet`, `OnPost`, or any other page handler.
76
+
The <xref:Microsoft.AspNetCore.Authorization.AuthorizeAttribute> can ***not*** be applied to Razor Page handlers. For example, `[Authorize]` can't be applied to `OnGet`, `OnPost`, or any other page handler. Consider using an ASP.NET Core MVC controller for pages with different authorization requirements for different handlers.
77
77
78
78
The following two approaches can be used to apply authorization to Razor Page handler methods:
0 commit comments