Saturday, 8 February 2014

Server.Transfer and Server.Execute



Both Server.Transfer and Server.Execute were introduced in Classic ASP 3.0 (and still work in ASP.NET).
When Server.Execute is used, a URL is passed to it as a parameter, and the control moves to this new page. Execution of code happens on the new page. Once code execution gets over, the control returns to the initial page, just after where it was called.
However, in the case of Server.Transfer, it works very much the same, the difference being the execution stops at the new page itself (means the control isn’t returned to the calling page).
In both the cases, the URL in the browser remains the first page URL (doesn’t refresh to the new page URL) as the browser isn’t requested to do so.


No comments:

Post a Comment