Esempio n. 1
0
 protected override void OnPreRender(EventArgs e)
 {
     //base.OnPreRender(e);
     //pHelp.Visible = false;
     pInit.Visible = false;
     GenerateAndRenderDemoData();
     if (_renderinfo.Template != null && !string.IsNullOrEmpty(_renderinfo.OutputString))
     {
         //Rendering was succesful.
         var lit = new LiteralControl(Server.HtmlDecode(_renderinfo.OutputString));
         Controls.Add(lit);
         var  mst = _renderinfo.Template.Manifest;
         bool editWitoutPostback = mst != null && mst.EditWitoutPostback;
         if (ModuleContext.PortalSettings.EnablePopUps && ModuleContext.IsEditable && editWitoutPostback)
         {
             AJAX.WrapUpdatePanelControl(lit, true);
         }
         _engine.IncludeMeta(Page);
     }
     if (LogContext.IsLogActive && !Debugger.IsAttached)
     {
         ClientResourceManager.RegisterScript(Page, Page.ResolveUrl("~/DesktopModules/OpenContent/js/opencontent.js"), FileOrder.Js.DefaultPriority);
         var json = JsonConvert.SerializeObject(LogContext.Current.ModuleLogs(ModuleContext.ModuleId));
         json = json.Replace("<script>", "*script*");
         json = json.Replace("</script>", "*/script*");
         StringBuilder logScript = new StringBuilder();
         //logScript.AppendLine("<script type=\"text/javascript\"> ");
         logScript.AppendLine("$(document).ready(function () { ");
         logScript.AppendLine("var logs = " + json + "; ");
         logScript.AppendLine("$.fn.openContent.printLogs(\"Module " + ModuleContext.ModuleId + " - " + ModuleContext.Configuration.ModuleTitle + "\", logs);");
         logScript.AppendLine("});");
         //logScript.AppendLine("</script>");
         Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "logScript" + ModuleContext.ModuleId, /*DotNetNuke.UI.Utilities.ClientAPI.EscapeForJavascript*/ (logScript.ToString()), true);
     }
 }
Esempio n. 2
0
 protected override void OnPreRender(EventArgs e)
 {
     //base.OnPreRender(e);
     //pHelp.Visible = false;
     try
     {
         engine.Render(Page);
     }
     catch (TemplateException ex)
     {
         RenderTemplateException(ex);
     }
     catch (InvalidJsonFileException ex)
     {
         RenderJsonException(ex);
     }
     catch (Exception ex)
     {
         LoggingUtils.ProcessModuleLoadException(this, ex);
     }
     GenerateAndRenderDemoData();
     if (_renderinfo.Template != null && !string.IsNullOrEmpty(_renderinfo.OutputString))
     {
         //Rendering was succesful.
         var lit = new LiteralControl(Server.HtmlDecode(_renderinfo.OutputString));
         Controls.Add(lit);
         var  mst = _renderinfo.Template.Manifest;
         bool editWitoutPostback = mst != null && mst.EditWitoutPostback;
         if (ModuleContext.PortalSettings.EnablePopUps && ModuleContext.IsEditable && editWitoutPostback)
         {
             AJAX.WrapUpdatePanelControl(lit, true);
         }
         try
         {
             engine.IncludeResourses(Page, this);
         }
         catch (Exception ex)
         {
             DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, ex.Message, DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.RedError);
         }
         //if (DemoData) pDemo.Visible = true;
     }
     if (LogContext.IsLogActive && !Debugger.IsAttached)
     {
         ClientResourceManager.RegisterScript(Page, Page.ResolveUrl("~/DesktopModules/OpenContent/js/opencontent.js"), FileOrder.Js.DefaultPriority);
         StringBuilder logScript = new StringBuilder();
         logScript.AppendLine("<script type=\"text/javascript\"> ");
         logScript.AppendLine("$(document).ready(function () { ");
         logScript.AppendLine("var logs = " + JsonConvert.SerializeObject(LogContext.Current.ModuleLogs(ModuleContext.ModuleId)) + "; ");
         logScript.AppendLine("$.fn.openContent.printLogs('Module " + ModuleContext.ModuleId + " - " + ModuleContext.Configuration.ModuleTitle + "', logs);");
         logScript.AppendLine("});");
         logScript.AppendLine("</script>");
         Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "logScript" + ModuleContext.ModuleId, logScript.ToString());
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Raises the <see cref="Control.Init"/> event.
        /// </summary>
        /// <param name="e">An <see cref="EventArgs"/> object that contains the event data.</param>
        protected override void OnInit(EventArgs e)
        {
            try
            {
                if (AJAX.IsInstalled())
                {
                    // AJAX.RegisterScriptManager();
                    AJAX.WrapUpdatePanelControl(this.SavedSearchesRepeater, true);
                }

                this.Load += this.Page_Load;
                this.SavedSearchesRepeater.ItemDataBound += this.SavedSearchesRepeater_ItemDataBound;
                this.AppliedJobsRepeater.ItemDataBound   += this.AppliedJobsRepeater_ItemDataBound;
                this.AppliedJobsRepeater.ItemCommand     += this.AppliedJobsRepeater_ItemCommand;
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }

            base.OnInit(e);
        }
        protected override void OnInit(EventArgs e)
        {
            if (!PermissionController.CanManageJobListingOptions(this))
            {
                this.DenyAccess();
                return;
            }

            if (AJAX.IsInstalled())
            {
                // AJAX.AddScriptManager(Page);
                AJAX.WrapUpdatePanelControl(this.LimitOptionPlaceholder, false);
                this.LimitCheckBox.CheckedChanged += this.LimitCheckBox_CheckedChanged;
                this.LimitCheckBox.AutoPostBack    = true;
            }

            this.LimitRangeValidator.MaximumValue = int.MaxValue.ToString(CultureInfo.InvariantCulture);

            this.Load += this.Page_Load;
            this.UpdateButton.Click += this.UpdateButton_Click;
            this.CancelButton.Click += this.CancelButton_Click;
            base.OnInit(e);
        }