Misunderstanding of using filter when using webapi in mvc4

Source: Internet
Author: User

The two angels started to use the webapi in mvc4 to build a shelf. They did not execute filter in any way during the last day or two.

As we all know, there are four time point functions in actionfilterattribute that can be reloaded. Why are these functions not involved?

After studying it over and over again, I finally figured it out from lunch till now.

Using system. Web. http. filters;

Note: When Using webapi, your actionfilterattribute must be in this namespace, not in system. Web. MVC.

Alas, I still don't know why. I want to study it. Let's add this record.

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.