我想由不少人都懂得在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 。

相关文章:

  • 2021-08-14
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2021-09-07
  • 2021-10-01
  • 2022-12-23
猜你喜欢
  • 2021-10-04
  • 2021-10-29
  • 2022-03-06
  • 2022-12-23
  • 2021-06-20
  • 2021-10-23
  • 2022-01-15
相关资源
相似解决方案