Action context for MVC: ActionExecutingContext

Source: Internet
Author: User

Let's see, everyone, ActionExecutingContext object A total of 3 references. Below I come one by one parse:

Call base. OnActionExecuting (Filtercontext) After this, will not perform the subsequent actionfilter, if you are sure only one, or do not want to follow up, then you can not call the statement

FilterContext.ActionDescriptor.ActionName the action name executed by the context

Filtercontext.result is the custom result returned after executing the context action.

And then we'll take a look at this actionexecutingcontext class, see

Here's a clearer explanation of what the ActionExecutingContext class can do for you. Of course, I would like to say that this class is generally used to filter the custom filter, for the controller itself inherits the ActionFilterAttribute base class, so it can be rewritten onactionexecuting the following describes the class-related methods

Method

Parameters

Describe

OnActionExecuting

ActionExecutingContext

Execute before the behavior method executes

onactionexecuted

ActionExecutedContext

Executes after the behavior method executes

Onresultexecuting

ResultExecutingContext

Executes before the behavior method returns

onresultexecuted

ResultExecutedContext

Executes after the behavior method returns

The four method execution order is onactionexecuting-->onactionexecuted-->onresultexecuting-->onresultexecuted

Action context for MVC: ActionExecutingContext

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.