Web 部件和 Aspx 之间的会话 - Sharepoint 2007
Web 部件和 Aspx 之间的会话 - Sharepoint 2007 我尝试在会话中传输一些信息,但使用 Responde.Redirect 不起作用。 当我使用 Server.Transfer(url) 时需要转到 /site-test/_layouts/teste.aspx,但当我将 Server.Transfer 与 _layouts/teste.aspx 一起使用时才有效
有人可以帮助我吗?
Session between webpart e Aspx - Sharepoint 2007
I trying to transfer some information in Session, but using Responde.Redirect doesn't work.
When I use Server.Transfer(url) needs to go to /site-test/_layouts/teste.aspx, but just works when I use Server.Transfer with _layouts/teste.aspx
Can anybody help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Server.Transfer 和 Response.Redirect 在 SharePoint 中不起作用,您应该使用 SPUtility.Redirect。此外,默认情况下,SHArePoint 中未启用会话(我认为仅在多服务器场中)。您必须在中央管理中启用它。请参阅这篇文章了解如何这样做。
请注意,当您的前端位于负载均衡器后面时,会话可能是一件棘手的事情,如果未将其设置为粘性会话,则回发可能会失败。
另一件事,如果您希望 Web 部件进行通信,则有一个专门用于此目的的机制,Sahil Malik 涵盖了基础知识 (ASP.NET) 此处,以及如何在 Sharepoint 此处。有关详细信息,请通过 Google 搜索 sharepoint Webpart 通信。
Server.Transfer and Response.Redirect do not work in SharePoint, You should use SPUtility.Redirect instead. Furthermore, sessions are not enabled in SHarePoint by default (only in multiserver farms I think). You have to enable it in Central Admin. See this post on how to do that.
Be aware sessions can be a tricky thing when your front-ends are behind a load-balancer, when that is not set to sticky sessions, postbacks could fail.
Another thing, if you want webparts to communicate, there is a mechanism in place just for that, Sahil Malik covers the basics (ASP.NET) here, and how it is done in Sharepoint here. For more info, google for sharepoint webpart communication.