我刚刚将 HttpContext.RewritePath(targetPath) 中的 ASP.Net 代码更新为使用 .Net 3.5 函数:HttpContext.Server.TransferRequest(targetPath,true)
但是,我现在不再拥有在传输之前添加的任何自定义 HttpContext.Items。
有人对我如何克服这个问题有任何想法吗?
最佳答案
根据documentation ,它保留了查询字符串和表单集合,但它没有提及上下文项。我想说你必须以其他方式发送它们:查询字符串或 session 。
关于asp.net - Server.TransferRequest 不保留 HttpContext.Items,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3700862/