Ich habe eine Aktion namens ForgetPassword. Jedes Mal, wenn ein Anonymer versucht, die Aktion abzurufen, wird er auf die Anmeldeseite umgeleitet. Unten sind meine Implementierungen.Erlaube Anonymous, bestimmte Aktion in asp.net mvc 3
public ActionResult ForgotPassword(string UserName)
{
//More over when i place a breakpoint for the below line
//its not even getting here
return View("Login");
}
Und hier ist ein Teil meiner Datei web.config
<location path="">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
<location path="Content">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="Scripts">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<location path="Images">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<authentication mode="Forms">
<forms loginUrl="/Home/Login" timeout="5" slidingExpiration="false" />
</authentication>
Haben Sie Ihre 'Controller/Action' mit' Authorize' Attribut versehen oder einen globalen 'Authorize' Filter registriert? – haim770