Dies ist wahrscheinlich eine dieser einfachen Fragen .. Ich versuche, den Benutzer umleiten, nachdem sie erfolgreich authentifiziert wurden, oder sie zurück auf die Anmeldeseite. Aber der Erfolg Seite ist auf einem anderen Weg, und ich kann die Umleitung nicht zu funktionieren bekommen ..ASP.Net MVC - Umleiten zu Route gibt Redirect Loop
Hier sind meine Routen in Globals.asax:
routes.MapRoute(_
"Default", _
"{controller}/{action}/{id}", _
New With {.controller = "Login", .action = "Index", .id = ""} _
)
routes.MapRoute(_
"Stuff", _
"{controller}/{action}/{id}", _
New With {.controller = "Stuff", .action = "Index", .id = ""} _
)
I 2 Controller haben: LoginController.vb
und StuffController.vb
. Die Views/Login/Index.aspx
Datei enthält ein einfaches Formular mit dem Code:
<form method="post" action="/Login/Authenticate">
Die LoginController
enthält den folgenden Code:
Function Authenticate() As RedirectToRouteResult
' authentication code commented out ;o)
Return RedirectToRoute("Stuff")
End Function
Und die StuffController enthält folgende Komponenten:
Function Index()
' show stuff..
Return View() ' return /Views/Stuff/Index.aspx
End Function
Hier ist, was ich Bisher versucht:
- Funktion Authenticate()
- Funktion Authenticate() As Action()
- Funktion Authenticate() As RedirectToRouteResult()
alle eine Redirect-Timeout-Schleife im Browser führen. Was vermisse ich?!
Große Frage, ich hatte das gleiche Problem! – MrBoJangles