だから私は次の web.config を持つ ASP.NET MVC3 アプリを持っています
<?xml version="1.0"?>
<configuration>
....
<system.web>
....
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" defaultUrl="~"
slidingExpiration="true" timeout="10080" />
</authentication>
そしてコントローラー:
[Authorize(Roles="admin")]
public class MetaStyleController : TunaController
{
....
public ActionResult Index()
{
....
ログインせずに をクリックしようとするとhttp//localhost/myAppPath/MetaStyle
、上記で定義したように、ログオン ページにリダイレクトされますよね?
では、なぜ にリダイレクトされるのhttp://localhost/myAppPath/Account/Login?ReturnUrl=%2fmyAppPath%2fMetaStyle
ですか? (注意、URL にはLogOnではなくLoginがあります)
どこLogin
から来ていますか?私のプロジェクトには表示されません。