开发者

sharepoint: Server.Transfer?

开发者 https://www.devze.com 2023-02-03 04:18 出处:网络
I am writing some code for sharepoint to transfer from this page to another page: Server.Transfer(\"/DefectManagement/DefectList/default.aspx\")

I am writing some code for sharepoint to transfer from this page to another page:

Server.Transfer("/DefectManagement/DefectList/default.aspx")

Bu开发者_运维技巧t I got this problem:

Error 1 'Microsoft.SharePoint.Portal.Topology.Server' does not contain a definition for 'Transfer'

How would this issue be done in sharepoint?

Thanks in advance.


The Server reference you have there (Microsoft.SharePoint.Portal.Topology.Server) is not the Server reference (System.Web.HttpServerUtility) you are looking for.

Try

System.Web.HttpContext.Current.Server.Transfer();
HttpContext.Current.Server.Transfer();
Page.Server.Transfer();

And yes, SPUtility.Redirect is better for sharepoint


You should use SPUtility.Redirect

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号