What is the order of execution in ASP.NET MVC Controller?
- by Xinxua
Say I have a controller called "HomeController" which inherits from Mvc.Controller. Also say I have written the constructor of the controller and some filters for some actions.
Public Class ClientController
Inherits System.Web.Mvc.Controller
Public Sub New()
''Some code
End Sub
<SomeActionFilter()> _
Function Index() As ActionResult
Return View()
End Function
End Class
My questions are :
What is the order of execution of constructor, filter, action?
Can I have a filter for the Constructor, if I do not want to run the code in it by checking for some conditions?