I know that how to use Actionfiltes in MVC but i am not understand that why we are using it, because we can write logic in action for both of this before execution and after then what is purpose of it? if any one give me proper example and explanation then it would be helpful me.
Regards, Vinit Patel
Action filters give you a centralized way to define a logic to execute before or after actions are executed. A few examples could be
You can add action filters to each action separately, or you can add them globally to all action using Global filters.
In general a filter means a piece of unit which you can chain into some kind of process to intercept and sometimes modify the flow. In terms of for example audio technology, a filter can be an effect (equalizer, compressor, etc.). In terms of MVC, it can be a unit which you want to plug into the MVC processing flow.