1

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?

Chuck Conway
  • 16,287
  • 11
  • 58
  • 101

2 Answers2

3

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.

Mehrdad Afshari
  • 414,610
  • 91
  • 852
  • 789
2

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

Zachary Yates
  • 12,966
  • 7
  • 55
  • 87