Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execution Priority in custom Attributes in asp.net mvc

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?

like image 729
Prasad Avatar asked Nov 20 '09 13:11

Prasad


1 Answers

Set the Order property.

[CustAttribute1(Order=2)]
[CustAttribute2(Order=1)]
public ActionResult Index() {
    return View();
}
like image 102
Darin Dimitrov Avatar answered Oct 27 '22 01:10

Darin Dimitrov