asp.net - Server.TransferRequest 不保留 HttpContext.Items

标签 asp.net .net-3.5 url-rewriting

我刚刚将 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/

相关文章:

.net - .NET 代码如何知道它是否在 Web 服务器应用程序中运行?

ASP.NET 成员(member)用户忘记密码

c# - 在 ASP .net WEB API 中使用属性路由进行版本控制

wcf - 如何自动发现 WCF 服务?

c# - SQL Server 日期函数

apache - ifModule mod_rewrite 标记在 .htaccess mod_rewrite 文件中是否多余

regex - 使用网址重写将www添加到网址

asp.net - 从 Repeater Control 生成的 Div 没有正确的 CSS 样式

c# - StatusStrip 等效项

.htaccess - 使用 .htaccess 删除动态链接上的目录