-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
area-ui-renderingIncludes: MVC Views/Pages, Razor Views/PagesIncludes: MVC Views/Pages, Razor Views/Pagesfeature-razor-pages
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Any razor page model, with an overridden PageModel.OnPageHandler*
method, without an explicit [NonHandler]
attribute, will be discovered as a potential page handler. Which is a little surprising. eg;
public class MyPageModel : PageModel
{
public override void OnPageHandlerExecuting(PageHandlerExecutingContext context)
{
// something....
base.OnPageHandlerExecuting(context);
}
}
I believe that this is due to comparing against methodInfo.DeclaringType
, instead of methodInfo.GetBaseDefinition().DeclaringType
in the following test;
aspnetcore/src/Mvc/Mvc.RazorPages/src/ApplicationModels/DefaultPageApplicationModelPartsProvider.cs
Line 193 in 7dbebe9
// Exclude the whole hierarchy of Page. |
Expected Behavior
No response
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
No response
Anything else?
No response
Metadata
Metadata
Assignees
Labels
area-ui-renderingIncludes: MVC Views/Pages, Razor Views/PagesIncludes: MVC Views/Pages, Razor Views/Pagesfeature-razor-pages