使用 HttpContext.RewritePath 来配合 Server.Transfer/Execute
作者:未知 来源:转载 发布时间:2005-7-25 21:26:45 发布人:acx
我想由不少人都懂得在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 。
如果在 Server.Transfer/Execute 的调用前,使用RewritePath,更可以起到指定QueryString的效果。
例如
Context.RewritePath("AA.Aspx","","OKOK=3333");
Context.Server.Transfer("Test2.Aspx");
这样,就能执行Test2.Aspx,并且QueryString是OKOK=3333。
这个用途特别大。我目前用这个方法来避免使用 Response.Redirect 。
上一篇:控制IE WebControl中TreeView的高度
下一篇:简单ASP计数器