Closed
Description
Hi,
I'm trying to get a custom ActionFilterAttribute to get working on the Get method of my Razor Pages.
Starting with a simple .NetCore Web project, I created a custom ActionFilterAttribute as :
`
public class MyCustomActionFilterAttribute : ActionFilterAttribute
{
///
/// Title of the current item
///
public string Title { get; set; }
public override void OnActionExecuting(ActionExecutingContext context)
{
// This method is NEVER called!!
System.Diagnostics.Debugger.Break();
}
}
`
Then I use it in my Index.cshtml.cs :
public class IndexModel : PageModel { [MyCustomActionFilter(Title ="My Title", Order =1)] public void OnGet() { } }
But the method OnActionExecuting is never called.
What am I missing ?
Regards.
François
TestCustomActionFilterAttribute.zip
Metadata
Metadata
Assignees
Labels
No labels