建设中(Metapost)
建设中,谢谢关注,本栏目将有Alldnnskins团队发布技术文档。
 
Alldnnskins技术文档

DotNetNuke URL DNN中的链接


发布时间:2009年10月21日 发布人:Alldnnskins 42.86%顶

DotNetNuke 模块包含一组用户控件(*.ascx 文件),他们都定义在“模块定义”(module definition)中。如果你查看DNN 源码,你会发现多数模块都包含 View Edit Setting 3个控件,这也是模块默认的3 个控件。查看这3 个控件之间的跳转代码,通常如下所示:

View controlEdit control 导航跳转的时候如下代码:

Response.Redirect(EditUrl())

Edit controlView control 导航跳转如下代码:

Response.Redirect(Globals.NavigateURL(), true)

You usually don't need a link for the Settings control. You simply configure the User Control in the module definition as a Settings control and a link is automatically created in the module's menu to navigate to it.

使用DNN中的导航方法 NavigateURL()

如下代码示例,点击按钮跳转

protected void cmdEdit_Click(object sender, EventArgs e)
{
  Response.Redirect(Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "mygallery", "mid=" + ModuleId.ToString()));
}

这段代码将创建如下链接:

http://localhost/MyDNNWebsite/Home/tabid/36/ctl/mygallery/mid/362/Default.aspx

NavigateURL 方法第一个参数是跳转的页面,第二个参数是module definition 中control key 的名字,第三个参数是moduleID 。

注意:这样产生的连接,调转后页面只会加载模块的一个控件,即跳转后你只能在页面上看模块的一个控件,页面上其他模块都不会加载。通常我们都只需要当前模块发生跳转,页面上其他的模块都还是在页面上正常显示的,如果需要同时能看到其他模块,我们可以用如下办法:

1) View Control 作为容器,容器中加载其他控件

2) 需要加载到 View 中的页面都不需要定义为 Module Control

View 中示例代码如下:

protected void Page_Load(System.Object sender, System.EventArgs e)
        {
            string token = Request["token"];
            string page = ResolveUrl(this.TemplateSourceDirectory + "/List.ascx");
            switch (token)
            {
                case "detail":
                    page = ResolveUrl(this.TemplateSourceDirectory + "/Detail.ascx");
                    break;
                case "new":
                    page = ResolveUrl(this.TemplateSourceDirectory + "/CreateNew.ascx");
                    break;
                default:
                    break;
            }

            PortalModuleBase objModule = (PortalModuleBase)LoadControl(page);
            objModule.ModuleConfiguration = this.ModuleConfiguration;
            this.Controls.Add(objModule);

        }

例如要跳转到 Detail.ascx ,代码如下:

Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(TabId, "", "token=new"));

注:token 只是一个参数名,可以自己改变定义。



上一篇  下一篇  返回
评论:
用户: jsrj 发布时间:07~01~2010
Welcome miscellaneous watches to miscellaneous Watches Boutique the source Gucci Watches for Gucci Watches sales, tips Hermes Watches trivia Hermes Watches
名称:
Enter the code shown above:
 
 
 

DNN产品

DNN模块
DNN皮肤
DNN视频
DNN站点
管理系统
DNNSEO
DEMO记录

DNN社区

人才招聘
DNN论坛
管理信息
团队博客
网络团队
DNN技术
求购源码

DNN服务

定制DNN网站
定制DNN皮肤
定制DNN模块
申请代理
项目交易

资源下载

DNN语言包
DNN安装包
DNN模块下载
DNN资料下载
DNN皮肤下载

合作伙伴

国外合作伙伴
国内合作伙伴
合作申请

联系我们

美国:9894 Bissonnet St. Suite 632, Houston, TX 77036.
电话:+1 832-266-1031
北京:朝阳区建国路郎家园8号尚八创意产业园D座DW105室
电话:+86-10-51665719-8008  15510008965
武汉:青山区园林路绿景花园2栋4单元502
电话:+86-27-86641441 15007175586 13100718965
电邮:contact@zhglobal.com  QQ:11852177

  
版权所有:宏宇国际 www.AllDnnSKins.CN 备案许可证号:鄂ICP备09017480号   |  隐私声明  |  服务条款  |