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
精彩评论