This is probably one of those easy questions.. I'm trying to redirect the user after they've successfully authenticated, or return them back to the login page. But the Success page is on a different route and I can't get the redirection to work..
Here are my routes 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've got 2 Controllers: LoginController.vb
and StuffController.vb
. The Views/Login/Index.aspx
file contains a simple form with the code:
<form method="post" action="/Login/Authenticate">
The LoginController
contains the following code:
Function Authenticate() As RedirectToRouteResult
' authentication code commented out ;o)
Return RedirectToRoute("Stuff")
End Function
And the StuffController contains the following:
Function Index()
' show stuff..
Return View() ' return /Views/Stuff/Index.aspx
End Function
Here's what I've tried so far:
- Function Authenticate()
- Function Authenticate() As ActionResult()
- Function Authenticate() As RedirectToRouteResult()
all of which cause a Redirect Loop timeout in the browser. What am I missing?!