Building a sample ASP.NET MVC app. Using the Membership API for authentication. For whatever reason, the code execution first goes to the default route (e.g. HomeController.Index method) instead of going to the specified login page.
My web.config is as follows:
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" />
</authentication>
What am I missing?
You need to put
[Authorize]attribute onActionorController