Skip to content

Commit d26d4aa

Browse files
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]>
1 parent 43ae480 commit d26d4aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aspnetcore/security/authorization/simple.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ This would allow only authenticated users to the `AccountController`, except for
7373

7474
## Authorize attribute and Razor Pages
7575

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.
7777

7878
The following two approaches can be used to apply authorization to Razor Page handler methods:
7979

0 commit comments

Comments
 (0)