Example #1
0
        public ActionResult Download(int id)
        {
            var scriptid = Request.Form["scriptid"];
            var enname   = Request.Form["enname"];

            if (string.IsNullOrEmpty(enname))
            {
                enname = "1";
            }
            ViewBag.ReturnUrl = Url.Action("Index", "Script", new { id = id });
            if (string.IsNullOrEmpty(scriptid))
            {
                return(View());
            }
            var remotes = SiteModel.GetRemoteScript(scriptid);

            foreach (var code in remotes)
            {
                ViewBag.ScriptUrl += string.Format("<script type=\"text/javascript\" src=\"{0}\"></script>\r\n", code.code);
            }
            ViewBag.DownloadUrl = Url.Action("DownloadFile", "Script", new { scriptid = scriptid, scriptname = enname });
            ViewBag.ScriptUrl  += string.Format("<script type=\"text/javascript\" src=\"/js/{0}.js\"></script>\r\n", enname);
            return(View());
        }