public void Process(SubmitSuccessArgs args)
        {
            Assert.IsNotNull((object)args, "args");

            if (args.Form != null && !args.Form.SuccessRedirect && FormHasGrantGatedAccessSaveAction(args))
            {
                string urlString = HttpContext.Current.Request.Url.AbsoluteUri;
                WebUtil.Redirect(urlString, true);
            }
        }
Exemple #2
0
 public void Process(SubmitSuccessArgs args)
 {
     Assert.IsNotNull(args, "args");
     string returnUrl = HttpContext.Current.Request["returnUrl"]
                        if (string.IsNullOrEmpty(returnUrl))
     {
         returnUrl = HttpUtility.ParseQueryString(HttpContext.Current.Request.UrlReferrer.Query)["returnUrl"];
     }
     if (!string.IsNullOrEmpty(returnUrl))
     {
         args.AbortPipeline();
         WebUtil.Redirect(returnUrl, false);
     }
 }
        private bool FormHasGrantGatedAccessSaveAction(SubmitSuccessArgs args)
        {
            bool isGatedForm = false;

            foreach (string gatedContentSaveActionId in _gatedContentSaveActionIds)
            {
                isGatedForm = args.Form.SaveActions.ToLower().Trim().Contains(gatedContentSaveActionId.Trim().ToLower());
                if (isGatedForm)
                {
                    break;
                }
            }

            return(isGatedForm);
        }