odwrotnie said:
So how this transfer works? Is it have something in common with AJAX? And
why does the address stays unchanged with transfer?
If there is no trip to the client, how does it works that the page is
displayed?
The asp.net model is based on the page controller pattern. ASP.Net provides
a page controller that gets the request, finds and executes the page, and
returns the HTML stream. Server.Transfer changes that flow.
So instead of this:
Controller gets request
Controller finds requested page
Controller loads and executes page
Controller wraps output of page in HTTP protocol and ships it back
You get this
Controller gets request
Controller finds requested page
Controller loads and executes page
Page tells controller to find a new page
Controller finds transferred page
Controller loads and executes page
Controller wraps output of page in HTTP protocol and ships it back
All this happens server side. The client is still waiting on their original
request and has no idea that it has occurred. It is quite normal for there
to be pages on the server that are ONLY accessible by server.transfer, where
the client gets the output but never sees the URL.
No, this has nothing to do with the Ajax model, although this mechanism can
be used for any web interaction, including Ajax, limited only by the
creativity of the developers and the requirements of the app.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--