Exemple #1
0
        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() }));
        }
Exemple #2
0
        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() });
        }
Exemple #3
0
        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 });
        }
Exemple #4
0
        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());
        }
Exemple #5
0
        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));
            }
        }