Nogwater
Nogwater

Reputation: 2797

How does ASP.NET HttpServerUtility.Transfer break the control flow?

By "how does" I mean "by what mechanism" not "to what effect". Control doesn't return to the calling method after you call Server.Transfer("...");. At the language runtime level, how does this happen? Does it throw an exception or trigger something that aborts the thread? I'm just curious. What are other examples of this pattern (calling a method to terminate execution)?

Upvotes: 2

Views: 403

Answers (1)

JaredPar
JaredPar

Reputation: 754645

It eventually calls End which throws a ThreadAbortException that terminates the current thread of execution. See the documentation here

Upvotes: 2

Related Questions