Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Server.Transfer vs. Response.Redirect
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00769347
Message ID:
00770579
Vues:
21
>Interesting point!. I guess I would call that, “Where am I syndrome”? :)

Yeah this is actually very important. I've found that in many cases I ended up not using Server.Transfer precisely for this reason and in ASP.Net applications there is even more reason to not use Server.Transfer() because Web forms tend to submit data on every request. If you happen to hit Refresh you resubmit that data, whcih may or may not be a problem.

Example: In my Web Store I have a page called AddItem which automatically adds an item to the shopping cart. If I use Server.Transfer() the shopping cart actually shows AddItem.aspx and if I refresh it adds antoehr item to the cart, which is not the behavior I would be looking for.

Web forms require a lot of 'redirect' style code which is one thing that is a little messy in my mind, but something that we have to live with in ASP.Net. The overhead of Response.Redirect() is minimal in terms of Web time, but it can add significant overhead in server time because a new page may have to rebuild the various Request objects each time...
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform