SharePoint中使用C#跳转页面的研究
2016-09-18 13:51
169 查看
最近开发SharePoint的时候遇到问题,不能完成跳转,于是归纳了一下方法。
1.最常用的页面跳转(原窗口被替代):Response.Redirect("XXX.aspx");
2.利用url地址打开本地网页或互联网:Respose.Write("<script language='javascript'>window.open('"+ url+"');</script>");
3.原窗口保留再新打开另一个页面(浏览器可能阻止,需要解除):Response.Write("<script>window.open('XXX.aspx','_blank')</script>");
4.效果同1中的另一种写法:Response.Write("<script>window.location='XXX.aspx'</script>");
5.也是原窗口被替代的 (常用于传递session变量的页面跳转):Server.Transfer("XXX.aspx");
6.原窗口保留,以对话框形式打开新窗口:Response.Write("<script>window.showModelessDialog('XXX.aspx')</script>");
7.对话框形式打开新窗口,原窗口被代替:Response.Write("<script>window.showModelDialog('XXX.aspx')</script>");
8.打开简洁窗口:Respose.Write("<script language='javascript'>window.open('"+url+"','','resizable=1,scrollbars=0,status=1,menubar=no,toolbar=no,location=no, menu=no');</script>");
9.利用vs2008端口:System.Diagnostics.Process.Start(http://localhost:10000.aspx);
最后使用sharepoint的时候发现上面的不能直接使用,所有方法被封装在Page对象中,需要使用Page.Response.Redirect()使用;
但是跳转的时候不知道为什么还是出现问题,因为项目时间有限,最后使用了js跳转。
1.最常用的页面跳转(原窗口被替代):Response.Redirect("XXX.aspx");
2.利用url地址打开本地网页或互联网:Respose.Write("<script language='javascript'>window.open('"+ url+"');</script>");
3.原窗口保留再新打开另一个页面(浏览器可能阻止,需要解除):Response.Write("<script>window.open('XXX.aspx','_blank')</script>");
4.效果同1中的另一种写法:Response.Write("<script>window.location='XXX.aspx'</script>");
5.也是原窗口被替代的 (常用于传递session变量的页面跳转):Server.Transfer("XXX.aspx");
6.原窗口保留,以对话框形式打开新窗口:Response.Write("<script>window.showModelessDialog('XXX.aspx')</script>");
7.对话框形式打开新窗口,原窗口被代替:Response.Write("<script>window.showModelDialog('XXX.aspx')</script>");
8.打开简洁窗口:Respose.Write("<script language='javascript'>window.open('"+url+"','','resizable=1,scrollbars=0,status=1,menubar=no,toolbar=no,location=no, menu=no');</script>");
9.利用vs2008端口:System.Diagnostics.Process.Start(http://localhost:10000.aspx);
最后使用sharepoint的时候发现上面的不能直接使用,所有方法被封装在Page对象中,需要使用Page.Response.Redirect()使用;
但是跳转的时候不知道为什么还是出现问题,因为项目时间有限,最后使用了js跳转。
相关文章推荐
- 使用HttpModule控制SharePoint页面跳转
- C# 3.0新特性初步研究 Part3:使用拉姆达表达式
- C# 3.0新特性初步研究 Part6:使用查询表达式
- C# 3.0新特性初步研究 Part4:使用集合类型初始化器_C#教程
- C# 3.0新特性初步研究 Part3:使用拉姆达表达式_C#教程
- C# 3.0新特性初步研究 Part6:使用查询表达式 _C#教程
- C# 3.0新特性初步研究 Part1:使用隐含类型的本地变量
- 使用锚点实现页面内跳转
- C# 3.0新特性初步研究 Part1:使用隐含类型的本地变量_C#教程
- C# 3.0新特性初步研究 Part1:使用隐含类型的本地变量_C#教程
- Video:使用VSeWSS创建定制SharePoint页面
- 使用无刷新技术,去请求该失效Session的页面,实现跳转到重新登陆页面。
- C# 3.0新特性初步研究 Part2:使用扩展方法_C#教程
- C# 3.0新特性初步研究 Part1:使用隐含类型的本地变量_C#教程
- C# 3.0新特性初步研究 Part4:使用集合类型初始化器_C#教程
- C# 3.0新特性初步研究 Part4:使用集合类型初始化器
- O/R Mapping 研究报告(5) --- 使用NHibernate进行开发--Vs 2005 C# (转自 飞鹰手记)
- C# 3.0新特性初步研究 Part4:使用集合类型初始化器_C#教程
- C# 3.0新特性初步研究 Part3:使用拉姆达表达式_C#教程
- Video:使用VSeWSS创建定制SharePoint页面