[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
Code:
[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" };
}
}