Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Pete Field 4 posts 24 karma points
    Apr 11, 2014 @ 16:19
    Pete Field
    0

    Umbraco v7 async controller action

    Is it possible to use an async action within an Umbraco SurfaceController (and UmbracoApiController)

    I tried the following code

    public async Task< ActionResult> HandleLogin(LoginViewModel model)
    {
        await Task.Delay(1000);
        return PartialView("Login", model);
    }
    

    and although it compiled correctly when the action is called the action seems to return as soon as the await is hit, and returns a string

    System.Threading.Tasks.Task`1[System.Web.Mvc.ActionResult]

    the controller of course inherits from SurfaceController and I wonder if this is the problem?

    If this is not possible, are there any workarounds to achieve async action behaviour?

  • Lior 2 posts 51 karma points
    May 14, 2014 @ 10:01
    Lior
    0

    Hi Pete,

    Did you find any soultion?

     

  • Pete Field 4 posts 24 karma points
    May 14, 2014 @ 10:19
Please Sign in or register to post replies

Write your reply to:

Draft