背景:
阅读新闻

使用 HttpContext.RewritePath 来配合 Server.Transfer/Execute

[日期:2004-12-01] 来源:迷失网络  作者: [字体: ]

我想由不少人都懂得在Applicaton_Start等事件中使用HttpContext.RewritePath来改变HttpHandler。

如果在 Server.Transfer/Execute 的调用前,使用RewritePath,更可以起到指定QueryString的效果。

例如

Context.RewritePath("AA.Aspx","","OKOK=3333");
Context.Server.Transfer("Test2.Aspx");

这样,就能执行Test2.Aspx,并且QueryString是OKOK=3333。

这个用途特别大。我目前用这个方法来避免使用 Response.Redirect 。

收藏 推荐 打印 | 录入:木鸟 | 阅读:
相关新闻      
本文评论   [发表评论]   全部评论 (0)
热门评论