Export (0) Print
Expand All

Controller.OnActionExecuted Method

Called after the action method is invoked.

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

'Declaration
Protected Overridable Sub OnActionExecuted ( _
	filterContext As ActionExecutedContext _
)
'Usage
Dim filterContext As ActionExecutedContext

Me.OnActionExecuted(filterContext)

Parameters

filterContext
Type: System.Web.Mvc.ActionExecutedContext
Information about the current request and action.

If this method is overridden in a derived Controller class, it will be called for every action method in the class. For more flexibility, derive a class from ActionFilterAttribute and override this method in the derived ActionFilterAttribute class.

The following example shows how to trace the action name after the action method runs.

Public Overloads Overrides Sub OnActionExecuted(ByVal ctx As ActionExecutedContext) 
    MyBase.OnActionExecuted(ctx) 
    ctx.HttpContext.Trace.Write("Log: OnActionExecuted", "After " &       ctx.ActionDescriptor.ActionName) 
End Sub  

Community Additions

Show:
© 2014 Microsoft