Partager via


Filter.Order Property

Gets the order in which the filter is applied.

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

Syntax

'Declaration
Public Property Order As Integer
'Usage
Dim instance As Filter
Dim value As Integer

value = instance.Order

instance.Order = value
public int Order { get; protected set; }
public:
property int Order {
    int get ();
    protected: void set (int value);
}
function get Order () : int
protected function set Order (value : int)

Property Value

Type: System.Int32
The order in which the filter is applied.

Remarks

Filters are run in the order of the filter type. Authorization filters run first and exception filters run last. Within each filter type, the Order value specifies the order. The execution order of filters with the same order and scope is undefined. OnActionExecuting(ActionExecutingContext), OnResultExecuting(ResultExecutingContext) and OnAuthorization(AuthorizationContext) are run in forward order; OnActionExecuted(ActionExecutedContext), OnResultExecuting(ResultExecutingContext), and OnException(ExceptionContext) are run in reverse order. For more information about ASP.NET MVC filters, see Filtering in ASP.NET MVC.

See Also

Reference

Filter Class

System.Web.Mvc Namespace