在自定义的执行优先级属性在asp.net mvc的 [英] Execution Priority in custom Attributes in asp.net mvc

查看:176
本文介绍了在自定义的执行优先级属性在asp.net mvc的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的asp.net MVC(C#)应用两个自定义属性。

I have two custom attributes in my asp.net mvc(C#) application.

[CustAttribute1()]
[CustAttribute2()]

当我使用这些属性来我的行动,这将让先执行?

When I use those attributes to my actions, which will get executed first?

[CustAttribute1()]
[CustAttribute2()]
public ActionResult Index()
{

我可以使用超过对我的行为一个自定义属性?如果是这样,在上述行动,该自定义属性开始执行首?

Can I use more than one custom attributes for my actions? If so, in the above Action, which custom attribute will execute first?

推荐答案

设置的订单属性。

[CustAttribute1(Order=2)]
[CustAttribute2(Order=1)]
public ActionResult Index() {
    return View();
}

这篇关于在自定义的执行优先级属性在asp.net mvc的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆