Esempio n. 1
0
 private void RenderTemplateException(TemplateException ex)
 {
     DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, "<p><b>Template error</b></p>" + ex.MessageAsHtml(), DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.RedError);
     //DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, "<p><b>Template source</b></p>" + Server.HtmlEncode(ex.TemplateSource).Replace("\n", "<br/>"), DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.BlueInfo);
     //DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, "<p><b>Template model</b></p> <pre>" + JsonConvert.SerializeObject(ex.TemplateModel, Formatting.Indented)/*.Replace("\n", "<br/>")*/+"</pre>", DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.BlueInfo);
     //lErrorMessage.Text = ex.HtmlMessage;
     //lErrorModel.Text = "<pre>" + JsonConvert.SerializeObject(ex.TemplateModel, Formatting.Indented)/*.Replace("\n", "<br/>")*/+"</pre>";
     if (LogContext.IsLogActive)
     {
         var logKey = "Error in tempate";
         LogContext.Log(ModuleContext.ModuleId, logKey, "Error", ex.MessageAsList());
         LogContext.Log(ModuleContext.ModuleId, logKey, "Model", ex.TemplateModel);
         LogContext.Log(ModuleContext.ModuleId, logKey, "Source", ex.TemplateSource);
         //LogContext.Log(logKey, "StackTrace", ex.StackTrace);
         //DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, "<p>More info is availale on de browser console (F12)</p>", DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.BlueInfo);
     }
     LoggingUtils.ProcessLogFileException(this, ex);
 }
 private void RenderTemplateException(TemplateException ex, ModuleInfo module)
 {
     DotNetNuke.UI.Skins.Skin.AddPageMessage(Page, "OpenContent RenderModule SkinObject", "<p><b>Template error</b></p>" + ex.MessageAsHtml(), DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.RedError);
     if (LogContext.IsLogActive)
     {
         var logKey = "Error in tempate";
         LogContext.Log(module.ModuleID, logKey, "Error", ex.MessageAsList());
         LogContext.Log(module.ModuleID, logKey, "Model", ex.TemplateModel);
         LogContext.Log(module.ModuleID, logKey, "Source", ex.TemplateSource);
     }
     LoggingUtils.ProcessLogFileException(this, module, ex);
 }