Exemplo n.º 1
0
        protected ContentResult CloseFrameDialog(DialogCloseOption option)
        {
            var ret     = "";
            var builder = new TagBuilder("script");

            builder.MergeAttribute("type", "text/javascript");

            if (Request["ReloadURL"] != null && Request["ReloadID"] != null)
            {
                ret += "parent." + Javascript.RemoteFunc(new RemoteOption
                {
                    URL    = Request["ReloadURL"],
                    Update = Request["ReloadID"]
                });
            }
            builder.InnerHtml += ret + ";";
            if (option.Message != null)
            {
                builder.InnerHtml += "alert(\"" + option.Message + "\");";
            }
            if (option.RunJS == null)
            {
                option.RunJS = Request.Params.Get("RunJS");
            }
            if (!string.IsNullOrEmpty(option.RunJS))
            {
                builder.InnerHtml += "parent." + option.RunJS + ";";
            }
            //builder.InnerHtml += "parent.Core.dialog.closeBox();";
            return(Content(builder.ToString()));
        }
Exemplo n.º 2
0
        /// <summary>
        /// close dialog
        /// </summary>
        /// <param name="option"></param>
        /// <returns></returns>
        protected JsonResult CloseDialog(DialogCloseOption option)
        {
            if (option.ReloadID == null)
            {
                option.ReloadID = Request.Params.Get("ReloadID");
            }

            if (option.ReloadURL == null)
            {
                option.ReloadURL = Request.Params.Get("ReloadURL");
            }

            if (option.RunJS == null)
            {
                option.RunJS = Request.Params.Get("RunJS");
            }

            return(Json(new
            {
                complete = option.Close,
                message = option.Message,
                eventName = option.EventName,
                eventData = option.EventData,
                reloadID = option.ReloadID,
                reloadURL = option.ReloadURL,
                redirectURL = option.RedirectURL,
                runJS = option.RunJS
            }));
        }