相关疑难解决方法(0)

MVC4 .NET 4.5 异步操作方法不重定向

我正在尝试在我的 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)

c# asp.net-mvc async-await .net-4.5

4
推荐指数
1
解决办法
8672
查看次数

标签 统计

.net-4.5 ×1

asp.net-mvc ×1

async-await ×1

c# ×1