DNN常用的几种页面跳转

DNN常用的几种页面跳转(EditUrl和Globals.NavigateURL) 

<script type="text/javascript"> document.body.oncopy = function() { if (window.clipboardData) { setTimeout(function() { var text = clipboardData.getData("text"); if (text && text.length>300) { text = text + "/r/n/n本文来自CSDN博客,转载请标明出处:" + location.href; clipboardData.setData("text", text); } }, 100); } } </script> <script class="blogstory">function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}</script>

看过我的视频教程或下载过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"));


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

摘自中国DNN联盟http://www.dnnme.cn/showtopic-466.aspx

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值