ASP. net mvc action Filter

Source: Internet
Author: User

ASP. net mvc contains the following four different types of action filters:

Type Time to use Interface Implementation Method
Authorization Filter) Executed before any filter or action is executed for identity authentication. Iauthorizationfilter Authorizeattribute
Action Filter) Before or after an action is executed, when the action to be executed needs to generate records or cache data Iacationfilter Actionfilterattribute
Result Filter) It is executed before or after any actionresult is executed. You can execute some logic operations or modify the output result of viewresult before the view is displayed in the browser. Iresultfilter Actionfilterattribute
Exception Filter) It is executed before or after the action is executed, or before or after the result is executed. When an exception occurs during execution, you can use this filter to point to other pages to display the error message. Iexceptionfilter Iexceptionfilter

The execution sequence of these four different types of action filters:

Validateinput attributes

 
[Httppost, validateinput (False)]PublicActionresult edit (IntID, formcollection formvalues ){ReturnView ();}

 

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.