1.Cache处理泛型方法Get/Set
DotNetNuke.Common.Utilities.DataCache.GetCache
DotNetNuke.Common.Utilities.DataCache.SetCache
DotNetNuke.Common.Utilities.DataCache.SetCache
2.得到当前模块的View url
DotNetNuke.Common.Globals.NavigateUrl(TabId)
3.模块的异常处理代码
DontNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException
4.获取不包含管理员页面的集合
Globals.GetPortalTabs(PortalSettings.DesktopTabs, false, true, false, true);
5.DNN下载文件的方法,其中第一个参数为FileID=7这种格式:
Response.Redirect(Globals.LinkClick(crlist[i].URL, TabId, ModuleId, false, true));
6.绑定国家列表:
7.通过EventLog添加记录
Globals.GetPortalTabs(PortalSettings.DesktopTabs, false, true, false, true);
5.DNN下载文件的方法,其中第一个参数为FileID=7这种格式:
Response.Redirect(Globals.LinkClick(crlist[i].URL, TabId, ModuleId, false, true));
6.绑定国家列表:
ListController listcontr = new ListController();
ListEntryInfoCollection listentries = listcontr.GetListEntryInfoCollection("Country");
drpText1.DataSource = listentries;
drpText1.DataValueField = "Value";
drpText1.DataTextField = "Text";
drpText1.DataBind();
7.通过EventLog添加记录
//Event
DotNetNuke.Services.Log.EventLog.EventLogController objEventLog = new DotNetNuke.Services.Log.EventLog.EventLogController();
DotNetNuke.Services.Log.EventLog.LogInfo objEventLogInfo = new DotNetNuke.Services.Log.EventLog.LogInfo();
objEventLog.AddLog("Sample Message", ReferrerURL, PortalSettings, -1, DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.ADMIN_ALERT);
8.DNN 模块快速安装多个模块
你还因为DNN站点多个模块用默认上传模块方式繁琐的步骤而烦恼吗?现在告诉大家一个批量上传DNN模块的方法,只需要几秒钟就完成,几分钟或许是十几分钟的操作,从而提高你的工作效率。如下:
1.首先把所有模块PA包放在domain/install/module/文件夹下(domain表示你的网址)
2.然后在浏览器中输入http://domain/install/install.aspx?mode=installresources 。
3.所有模块将会自动安装。
1.首先把所有模块PA包放在domain/install/module/文件夹下(domain表示你的网址)
2.然后在浏览器中输入http://domain/install/install.aspx?mode=installresources 。
3.所有模块将会自动安装。
如果想得远一点:把该方法融入到自动化部署、自动UI脚本测试中相信这是一个相当好的提高软件质量的敏捷实践。
9.DNN模块引用模块中的图片
a.如果你正在使用控件,那么你可以用以下方式指定:
|
|
10.DNN中向界面显示模块消息
Skin.AddModuleMessage(this , GetLocalizedString("Error.NoAlbums"), ModuleMessage.ModuleMessageType .BlueInfo);
11.如何在DNN后台产生用dnnModal.show脚本
DotNetNuke.Common.Utilities.UrlUtils名称空间下PopUpUrl系列方法,此处仅例句一个函数声明
public static string PopUpUrl( string url, Control control,PortalSettings portalSettings,
bool onClickEvent, bool responseRedirect,int windowHeight, int windowWidth, bool refresh, string closingUrl);
12.如何在后台得到DNN中通用的图标库中的图标url
DNN提供了一份通用的后台图标库(如下图),其目录位置在【DNN Website】\Icons\Sigma目录下
要在后台得到这些icon请参考接下来的代码片段:
var urlFormat = (Request.IsSecureConnection) ? "https://" : "http://";
p_AddImage = string.Concat(urlFormat, PortalSettings.PortalAlias.HTTPAlias, IconController.IconURL("【Icon Key】", "16x16"));