📄 viewtemplet.ascx.cs
字号:
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DNNLite.Entites.Modules;
using Ader.TemplateEngine;
using DNNLite.DesktopModules.Templet ;
using NHibernate.Expression;
public partial class DesktopModules_Templet_viewTempletl : PortalModuleBase ,IActionable
{
protected void Page_Load(object sender, EventArgs e)
{
string content = (string)DataCache.GetCache("cnt");
if (content == null)
{
Templet h = Templet.FindFirst(new EqExpression("TabModuleId", TabModuleInfo.TabModuleId));
if (h != null)
{
content = Server.HtmlDecode(h.Content);
DataCache.AddCache(content, "cnt");
}
else
{
content = "";
}
}
templetcontent = content;
}
private string templetcontent=string.Empty ;
protected override void Render(HtmlTextWriter writer)
{
try
{
TemplateManager tm = TemplateManager.FromString(templetcontent);
IDictionary<string, object> databag = new Dictionary<string, object>();
DNNLite.Entites.Modules.TempletPortalModuleBase.AddCommBag(ref databag);
foreach (string key in databag.Keys)
{
tm.SetValue(key, databag[key]);
}
tm.Process(writer);
}
catch (Exception ex)
{
ProcessModuleLoadException(ex);
}
}
#region IActionable 成员
public IList<DNNLite.Entites.Modules.ModuleAction> GetCommands()
{
IList<ModuleAction> result = new List<ModuleAction>();
result.Add(new ModuleAction("管理模板", "Edit", EditUrl("Edit")));
return result;
}
#endregion
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -