简体   繁体   中英

Will Server.Transfer work across AppDomains/Web Applications?

If you have two applications residing on the same server, can you use Server.Transfer to load a page in a different AppDomain/Application?

My guess is no, because Server.Transfer() copies HttpContext.Items, among other things. To copy this data between AppDomains, would cause threading and memory sharing concerns a in a world were thread isolation is strictly enforced.

Thoughts?

Nope, it's not possible.

Server.Transfer and Server.Execute cannot be used in these scenarios.

It does not, however, copy the HttpContext.Items . It's not copied. The same HttpContext is reused.

You can't use Server.Transfer() across web apps. The reason being that it actually just changes the page that the HttpHandler was going to return, rather than finishing the request and making a new one. It causes an extra trip to the browser, but Response.Redirect() is really the way to do it.

Server.Transfer vs Response.Redirect

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM