Use httpContext.rewritePath to match Server.TransferExecute (transfer)

xiaoxiao2021-03-06  86

I want to use HttpContext.rewritePath to change Httphandler in an event such as Applicaton_Start.

If you use the RewritePath before the call of Server.Transfer / Execute, you can also specify the QueryString effect.

E.g

Context.rewritePath ("AA.ASPX", "", "OKOK = 3333"); Context.Server.Transfer ("Test2.aspx");

In this way, Test2.aspx can be executed, and queryString is OKOK = 3333.

This use is particularly large. I currently use this method to avoid using Response.Redirect.

转载请注明原文地址:https://www.9cbs.com/read-107090.html

New Post(0)