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 (eg 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?
您需要在Action
或Controller
上放置[Authorize]
属性
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.