protected JsonResult Do(WindowAction action) { if (Actions.OfType <NotificationAction>().Any()) { if (new[] { WindowAction.Refresh, WindowAction.CloseModalRefreshParent }.Contains(action)) { NotificationAction.ScheduleForNextRequest(Actions); } } return(AddAction(new { BrowserAction = action.ToString() })); }
public void Do(WindowAction action) { if (this.OfType <NotificationAction>().Any()) { if (new[] { WindowAction.Refresh, WindowAction.CloseModalRefreshParent }.Contains(action)) { NotificationAction.ScheduleForNextRequest(); } } Add(new { BrowserAction = action.ToString() }); }
public void Redirect(string url, bool withAjax = false, string target = null) { url = url.Or("#"); if (!url.OrEmpty().ToLower().StartsWithAny("/", "http:", "https:")) { url = "/" + url; } NotificationAction.ScheduleForNextRequest(); Add(new { Redirect = url, WithAjax = withAjax, Target = target }); }
public ActionResult AjaxRedirect(string url) { url = url.Or("#"); if (!url.OrEmpty().ToLower().StartsWithAny("/", "http:", "https:")) { url = "/" + url; } if (Actions.OfType <NotificationAction>().Any()) { NotificationAction.ScheduleForNextRequest(Actions); } Actions.Add(new { Redirect = url, WithAjax = true }); return(JsonActions()); }
public ActionResult Redirect(string url, string target = null) { url = url.Or("#"); if (!url.OrEmpty().ToLower().StartsWithAny("/", "http:", "https:")) { url = "/" + url; } if (Actions.OfType <NotificationAction>().Any()) { NotificationAction.ScheduleForNextRequest(Actions); } if (Request.IsAjaxCall() || target.HasValue()) { Actions.Add(new { Redirect = url, Target = target }); return(JsonActions()); } else { return(base.Redirect(url)); } }
/// <summary> /// Creates a ViewResult object by using the model that renders a view to the response. /// </summary> protected new internal async Task <ViewResult> View(string viewName, object model) { AddAction(await NotificationAction.GetScheduledNotification()); return(base.View(viewName, model)); }
internal void ScheduleNotifications() => Add(NotificationAction.GetScheduledNotification());