当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - how to external function which get fire on every request in mvc4

问题描述:

I am working on already develop project in which now i need to check for the subscription is expired or not on every http request. So I need have write a dll which contain the expiry date and validation function to validate the subscription to if subscription is expired the system redirect to subscription renewal page to renew subscription. if user renew subscription then user get the new ddl with updated dates now user just upload this file in bin folder.

I am very new for such kind of functionality please give the way to have this done. i have google it I have got ActionFilterAttribute but for this i need to add the filter on every action(I dont want to do this) if any one remove this then i will by pass the validation.

网友答案:

You can create BaseController like

[YourNewAttribute]
public abstract class BaseController : Controller

and then inherit all your controllers from it

分享给朋友:
您可能感兴趣的文章:
随机阅读: