--- title: "MVC1001: Filters cannot be applied to page handler methods" description: "Learn about analysis rule MVC1001: Filters cannot be applied to page handler methods" author: pranavkm monikerRange: '>= aspnetcore-3.1' ms.author: riande ms.date: 10/21/2021 no-loc: [Home, Privacy, Kestrel, appsettings.json, "ASP.NET Core Identity", cookie, Cookie, Blazor, "Blazor Server", "Blazor WebAssembly", "Identity", "Let's Encrypt", Razor, SignalR] uid: diagnostics/mvc1001 --- # MVC1001: Filters cannot be applied to page handler methods | | Value | |-|-| | **Rule ID** |MVC1001| | **Fix is breaking or non-breaking** |Non-breaking| ## Cause An attribute implementing was applied to a Razor Page handler method. ### Rule description Razor Page handler methods are selected after MVC filter exeuction has started, and consequently cannot contribute filters to execute. Applying a filter to a Razor Page handler is unsupported and always incorrect. ## How to fix violations Remove the filter from the handler and apply it to a page. If a filter has to be applied to a specific handler, consider using multiple Razor Pages. ## When to suppress warnings Don't suppress warnings from this rule.