我正在尝试在我的 MVC 4 应用程序中实现一个任务操作方法。一切都在后面工作,但它不是重定向。
public class AccountController : AsyncController
{
[HttpPost]
[AllowAnonymous]
public async Task<ActionResult> Login(LoginModel model, string returnUrl)
{
var client = new ClientHelper("login");
account = await client.CallActionType<LoginModel, Account>(EnumHelpers.HttpType.Post, model);
if (account != null)
{
validLogin = true;
}
return Redirect(returnUrl); // This is called but the page does not redirect, just sits a load
}
}
Run Code Online (Sandbox Code Playgroud)