Friday 14 March 2014

MVC 4.0 QUESTIONS

 What is the significance of NonActionAttribute?

In general, all public methods of a controller class are treated as action methods. If you want prevent this default behavior, just decorate the public method with NonActionAttribute.
How route table is created in ASP.NET MVC?

When an MVC application first starts, the Application_Start() method is called. This method, in turn, calls the RegisterRoutes() method. The RegisterRoutes() method creates the route table.

What are the 2 ways of adding constraints to a route?

1. Use regular expressions
2. Use an object that implements IRouteConstraint interface

If I have multiple filters implemented, what is the order in which these filters get executed?

1. Authorization filters
2. Action filters
3. Result/Response filters
4. Exception filters

No comments:

Post a Comment