My quick recap!
- Sends a HTTP 302 to the client browser
- Client browser does a HTTP-GET of that new page
Note to Redirect Method
Take a look at System.Web.HttpResponse.Redirect in Reflector and see how MS creates a hardcoded html, head, body construct... :-)
Before we meet Server.Transfer meet:
- Executes the other page
- Control-flow jumps to new page and
- Returns back if finished...
- Sends all of the information that has been assembled for processing by one .aspx file to a the parameter path (.aspx page).
Insight to Server.Transfer
Server.Transfer does a Server.Execute(path, null, true);
but with a Response.End after return from Execute
last param = preserveForm
Advantages of Response.Redirect
Can redirect to external urls (even .html or classic asp-pages)
Url of new page is in browser adress bar
is this an advantage? :-)
Advantages of Server.Transfer
Server.Transfer can pass variables with HTTPContext.Items
PreviousPage property access is possible
Better performance cause no Client activity is involved
Server.Transfer bypasses the authorization for the page you redirect