In this article I am sharing my thoughts of the advantages of HandleUnknownAction in MVC application and the terminology being used.
HandleUnknownAction
This mechanism is used to examine an incoming URL and then decide which controller and action is to be executed. Called when a request matches this controller, but no method with the specified action name is found in the controller.
Open your Visual Studio, click on "File" -> "New" -> "Project..." and select ASP.NET MVC3 Web Application; see:
Specify the name of your first application as you desire and click "Ok".
A new window will appear, from that window I chose Intranet application from the many options there. Another interesting fact is that there is a dropdown named "View Engine". I selected "Razor" that is more specific to MVC 3 and MVC 4 and kept the checkbox "Create a new unit test" unchecked.
Click on the "Ok" button.
The following depicts the default screen that appears after clicking the "OK" button with multiple folders.
I've registered a route system in such a way as:
The following example shows how to render views that do not have a matching ActionResult method. For example, if you have a Verification.cshtml view but no corresponding method exists that returns an ActionResult instance, the following example displays the Verification.cshtml view when a request to the Verification action is made on the controller. If there is no matching view then the error page displays a message. This example shows one way to use the HandleUnknownActionmethod.
If you notice, I've defined a default route in global.asax that first calls to action = "Verification" of the controller named Register.





Join the conversation! Your thoughts help the community grow.