zoukankan      html  css  js  c++  java
  • DNN常用的几种页面跳转(EditUrl和Globals.NavigateURL)

    DNN常用的几种页面跳转(EditUrl和Globals.NavigateURL)(转载自http://lwzdadi.blog.163.com/blog/static/50968098200891310265286/)

    看过我的视频教程或下载过Blog项目源码的用户都应该知道,我在演示中的页面跳转是在HTML页完成的.那么如果我们添加了一个自己的Button,要通过代码来完成页面的跳转,我们要怎么写跳转的代码呢?

    下面我就把常用的几种页面间的跳转列出来,大家可以参考一下.

    一、相同模块间

    1)跳转到ascx页面,不带参数

        Response.Redirect(EditUrl("","","ascx页面Key值"));

    2)跳转到ascx页面,带参数

        Response.Redirect(EditUrl("","","ascx页面Key值","BlogID1=Blog参数1","BlogID2=Blog参数2"));

    3)任意ascx页面到模块首页,不带参数

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

    4)任意ascx页面到模块首页,带参数

        int intTabID=this.TabId;

        Response.Redirect(Globals.NavigateURL(intTabID,"","op=Back"));

    二、不同模块间跳转

        DotNetNuke.Entities.Modules.ModuleController objModules=new    DotNetNuke.Entities.Modules.ModuleController();

        int intTabID=objModules.GetModuleByDefinition(PortalSettings.PortalId,"DM Blog").TabID;

    1)模块间跳转,不带参数

        Response.Redirect(Globals.NavigateURL(intTabID));

    2)模块间跳转,带参数

        Response.Redirect(Globals.NavigateURL(intTabID,"","BlogID1=Blog参数1","BlogID2=Blog参数2"));

    3)模块间跳转到另一模块的某个ascx页面,不带参数

        Response.Redirect(Globals.NavigateURL(intTabID,"ascx页面Key值"));

    4)模块间跳转到另一模块的某个ascx页面,不带参数

        Response.Redirect(Globals.NavigateURL(intTabID,"ascx页面Key值","BlogID1=Blog参数1","BlogID2=Blog参数2"));

    先写这么多吧,都是比较常用的,也是给自己做一个记录,以后查的时间就方便了。呵呵.

  • 相关阅读:
    ES6 函数的扩展2
    css3 UI元素状态伪类选择器
    HTML5 矩阵变换
    ES6 let和const命令(4)
    ES6 let和const命令(3)
    ES6 let和const命令(2)
    JVM的内存区域划分(一)
    MySQL的四种事务隔离级别
    快速排序
    Struts2与SpringMVC的区别
  • 原文地址:https://www.cnblogs.com/GDLMO/p/1882852.html
Copyright © 2011-2022 走看看