Jun 15, 2012, 3:46 PM
[CLOSED] How to redirect after login
Hi,
Can you tell me how to redirect after login. I'm using ASP.NET MVC. This is my code in Controllers
Can you tell me how to redirect after login. I'm using ASP.NET MVC. This is my code in Controllers
[AllowAnonymous]
public Ext.Net.MVC.AjaxResult ExtLogin()
{
var username = HttpContext.Request["username"];
var password = HttpContext.Request["password"];
var returnUrl = HttpContext.Request["ReturnUrl"];
if (WebSecurity.Login(username, password) == WebSecurity.MembershipLoginStatus.Success)
{
string script = "window.location.replace('" + returnUrl + "')";
return new Ext.Net.MVC.AjaxResult { Script = script };
}
else
{
return new Ext.Net.MVC.AjaxResult { ErrorMessage = "The username or password is incorrect" };
}
}
Last edited by Daniil; Jun 21, 2012 at 9:53 PM.
Reason: [CLOSED]