public void ExecuteAsync(string command) { // The command can contain some long running operation // we run as async by queing the action on a separate thread AsyncManager.QueueAction(() => { UserAccount user = null; if (Session[SessionHelper.UserData] != null && ((UserAccount)Session[SessionHelper.UserData]).Username == User.Identity.Name) { user = (UserAccount)Session[SessionHelper.UserData]; } else { user = UserAccountServiceFacade.GetUserByName(User.Identity.Name); } if (user == null) { throw new InvalidOperationException("User is null"); } else { Session[SessionHelper.UserData] = user; } var result = CommandInvoker.InvokeFromCompositeString(command, HttpContext); AsyncManager.Parameters["ViewName"] = result.ViewName; AsyncManager.Parameters["ViewData"] = result.ViewData; }); }