Last post Jan 27, 2021 05:17 PM by bruce (sqlwork.com)
Jan 27, 2021 11:41 AM|satyajyoti|LINK
How do I get action argument and response from ActionExecutedContext? I am using the following code
public override void OnActionExecuted(ActionExecutedContext actionContext)
var actionArguments = actionContext.ActionContext.ActionArguments;
var response = ((ObjectContent)actionContext.ActionContext.Response.Content).Value as ResponseBase;
Jan 27, 2021 03:44 PM|PatriceSc|LINK
Ypu tried actionContext.Result and actionContext.RouteData ?
Jan 27, 2021 05:17 PM|bruce (sqlwork.com)|LINK
not clear what you are trying to do.
to get the parameters in OnActionExecuting
var args = context.ActionArguments;
each arg will have a name and value
to get the action result its in the OnActionExecuted:
var result = context.Result
typically if you are calling a view this will be of type IActionResult. From this you can get the ViewBag and the Model that will be passed to the view.