Sign in
|
Join
ISerializable - Roy Osherove's Blog
Unit Testing, Agile Development, Leadership & .NET - By Roy Osherove
This Blog
Home
About
Syndication
RSS
Atom
Comments RSS
Search
Go
Navigation
Home
Blogs
News
My new book is out!
The Art Of Unit Testing
Buy and read it as I write it.
I work at:
Your ad here
The Art Of Unit Testing Book
Roy's Cool Tools
Subscribe!
Subscribe to ISerializable by Email
About
Hire me
Ask me
On my bookshelf
About me
Ego trip
Roy's Tools
5 Whys - a blog for team leaders
Key.bo - a search engine wiki for keyboard shortcuts
unit testing
ruby styff
All Developer Songs
It's Time for Violence
Que Sera Sera
Articles
3: Oops! Typed Datasets
Are
scalable!
4: Introduction To Regular Expressions
5: Practical Parsing Using Groups in Regular Expressions
6: UI Threading Helper Classes
Make Your App Support Plugins 2 - Dynamic Search (MSDN)
Winforms Data Binding Lessons Learned
Make Your App Support Plugins (MSDN)
1: Introduction to Typed Datasets
2: Typed Datasets Are No Silver Bullet
My articles on MSDNAA
7: Solving VS.NET Debugger Problems
Make your log files searchable using Regex and the XML classes (MSDN)
Introduction to TDD with NUnit
Fun with Unit Tests – Testing abstract classes
New: Creating a generic Site-To-RSS tool
.Net scripting
- the practical way
Simplified Database Unit testing using Enterprise Services
Creating custom test attributes easily with NUnit 2.2.1
Cool tools every .Net Dev should be aware of
Cool Tools every .Net developer should be aware of
New: The case for staged delivery and Agile methodologies
My .Net Deep Dive lectures on video
New: Defensive event publishing in .Net, part 1
Test Feasibility Matrix
Depenedency Breaking Issues
*new* Achieving And Recognizing Testable Software Designs – Part I
Favorite Blogs
The Morning Brew
Martin Fowler
Scott Hanselman
Joel On Software
.NET Weblogs
Microsoft Israel Community
The Runtime
Daniel Moth
Oren Eini
Jimmy Bogard
CodeBetter
Dustin Campbell
Guy Kawasaki
Stephen Toub
Research @ Intel
Udi Dahan
The Typemock Insider
My Projects
Vs.Net Settings import.export Add-in
SchemaHelper - auto-detect & create data relations
Proxy handling using ProxyFactory and ProxyInfo
BackgroundWorker implementation
XtUnit: An Unofficial Unit Testing Extensibility Framework - Add new attributes to NUnit or MbUnit e
Intercetpion Application Block
Extensibility Application Block
The Regulator
VS.Net 2003 registry tweaker
My Tools page
Regular Expressions
RegEx Lib
Expresso
Regex Blogs
Sites : .Net
.Net Tools List
.NetWebLogs Forums
Winforms FAQ
.Net Debugging Resources
.Net WebCasts & Others
.NetWeblogs Archive
MSDN Magazine
Design Patterns in C#
.Net Rocks Radio
.Net Resources
Howto: .Net common tasks
VB.Net blogs on MSDN
.NetSlackers
Sites : Misc
Regular Expression Library
MSR Downloads
Win2k3 Tweak Guide
About Microsoft Interviews
Tech Interview Riddles
Feedster
Amazon Light
C:\Utils
Sites : Unit Testing & XP
NUnitASP
Tips and techniques with NUnit
NUnit
NUnit Addin
XProgramming
MSDN Mag:Simplify Data Layer Unit Testing using Enterprise Services
Tags
.NET
.Net 2.0
.Net Original
.Net Quotations
.NetWeblogs Site
Addin Contest
ADO.Net
Agile
Agile Israel News
Agile Related
altnet
altnetconf
altnetisrael
Architecture
Art Of Unit Testing
ASP.NET
BDD
Blogging
C#
CLR
Community
Community News
Cool Articles
Cool sites
Cool Tools
Extensibility
Family
FeatureFocus
Free book chapters
General Software Development
Interview
Lean
Mobile
MSBuild
NDC09-Video
Off Topic
Open Source
Other
Product Reviews
Project Management
racer
Recommended books
Reflection
Regex
Regular Expressions
review
Security
Sharepoint
Silverlight
SOA
Songs
SQL Server
tdd
Team Agile News
Team System
TechEd 05
Testing Guidelines
TestReview
Threading
Tips & Tricks
Typed Datasets
Typemock
Unit Testing
Visual Studio
web
web services
WebCast
Windows Forms
WinFX
Recent Posts
How to: Move your blog off of weblogs.asp.net (aka ‘This Blog has moved’)
test – ignore
Bounty: 500$ is you can convert my blog to squarespace
Join me for a live webinar on unit testing with Isolator++ this thursday
What’s coming in Test Lint 1.5
Archives
November 2010 (2)
October 2010 (4)
September 2010 (4)
August 2010 (3)
July 2010 (2)
June 2010 (5)
May 2010 (6)
April 2010 (6)
March 2010 (4)
February 2010 (5)
January 2010 (11)
December 2009 (7)
November 2009 (7)
October 2009 (5)
September 2009 (6)
August 2009 (21)
July 2009 (7)
June 2009 (11)
May 2009 (13)
April 2009 (5)
March 2009 (21)
February 2009 (4)
January 2009 (2)
December 2008 (5)
November 2008 (6)
October 2008 (13)
September 2008 (4)
August 2008 (13)
July 2008 (19)
June 2008 (5)
May 2008 (17)
April 2008 (11)
March 2008 (13)
February 2008 (16)
January 2008 (21)
December 2007 (8)
November 2007 (18)
October 2007 (17)
September 2007 (15)
August 2007 (19)
July 2007 (18)
June 2007 (33)
May 2007 (16)
April 2007 (10)
March 2007 (15)
February 2007 (10)
January 2007 (11)
December 2006 (22)
November 2006 (18)
October 2006 (19)
September 2006 (30)
August 2006 (19)
July 2006 (27)
June 2006 (26)
May 2006 (32)
April 2006 (15)
March 2006 (20)
February 2006 (33)
January 2006 (23)
December 2005 (22)
November 2005 (41)
October 2005 (21)
September 2005 (7)
August 2005 (28)
July 2005 (41)
June 2005 (60)
May 2005 (14)
April 2005 (51)
March 2005 (31)
February 2005 (17)
January 2005 (63)
December 2004 (45)
November 2004 (35)
October 2004 (28)
September 2004 (36)
August 2004 (21)
July 2004 (44)
June 2004 (63)
May 2004 (62)
April 2004 (78)
March 2004 (64)
February 2004 (55)
January 2004 (67)
December 2003 (34)
November 2003 (67)
October 2003 (68)
September 2003 (113)
August 2003 (56)
July 2003 (112)
June 2003 (71)
May 2003 (136)
April 2003 (52)
March 2003 (81)
February 2003 (77)
Server.Transfer vs. Response.Redirect
My blog has moved.
You can view this post at the following address:
http://www.osherove.com/blog/2003/8/11/servertransfer-vs-responseredirect.html
Published
Monday, August 11, 2003 2:46 PM by
RoyOsherove
Filed under:
.Net Original
,
Cool Articles
Comments
Monday, August 11, 2003 11:06 AM by
Diego Gonzalez
#
re: Server.Transfer vs. Response.Redirect
Redirect, issues a 304 (http code) to the browser and the broser navigates to the next page.
Tansfer, changes the server processing of the HTTP reguest and start ejecuting anothe page without sending anything to the browser.
Tuesday, August 12, 2003 3:05 AM by
Blair Stephenson
#
re: Server.Transfer vs. Response.Redirect
Cool, I hadn't seen the context.items before.
I've just used querystrings in the past.
Tuesday, August 12, 2003 11:45 AM by sergio
#
re: Server.Transfer vs. Response.Redirect
One important difference : redirect emits a silent exception.
Thursday, January 29, 2004 2:31 AM by
Krishna vardhan
#
re: Server.Transfer vs. Response.Redirect
Redirect and Transfer both cause a new page to be processed. But the interaction between the client (web browser) and server (ASP.NET) is different in each situation.
Redirect: A redirect is just a suggestion – it’s like saying to the client “Hey, you might want to look at this”. All you tell the client is the new URL to look at, and if they comply, they do a second request for the new URL.
If you want to pass state from the source page to the new page, you have to pass it either on the URL (such as a database key, or message string), or you can store it in the Session object (caveat: there may be more than one browser window, and they’ll all use the same session object).
Transfer: A transfer happens without the client knowing – it’s the equivalent of a client requesting one page, but being given another. As far as the client knows, they are still visiting the original URL.
Sharing state between pages is much easier using Server.Transfer – you can put values into the Context.Items dictionary, which is similar to Session and Application, except that it lasts only for the current request. (search for HttpContext in MSDN). The page receiving postback can process data, store values in the Context, and then Transfer to a page that uses the values.
Monday, February 02, 2004 3:03 AM by
AMIR WYNE
#
re: Server.Transfer vs. Response.Redirect
Server.Transfer() : client is shown as it is on the requesting page only, but the all the content is of the requested page. Data can be persist accros the pages using Context.Item collection, which is one of the best way to transfer data from one page to another keeping the page state alive.
Response.Dedirect() :client know the physical loation (page name and query string as well). Context.Items loses the persisitance when nevigate to destination page
Monday, April 26, 2004 4:03 AM by joga reddy
#
re: Server.Transfer vs. Response.Redirect
Server.Transfer vs. Response.Redirect
A user sent me this blurb out of Wrox's ASP 3.0 Programmer's Reference regarding the differences between Server.Transfer and Response.Redirect:
The current page's context is also passed to the target page or resource. This includes the values of all the variables in all the intrinsic ASP objects, such as the collections of the Request, Response, and Session objects, and all their properties. The Application object context is also transferred, even if the page is within a different virtual application. The current transaction context is also passed to the new page, allowing it to take part seamlessly in any current transaction.
Meanwhile, the browser's address bar still shows the original URL, and the Back, Forward, and Refresh buttons work normally. When we use client-side redirection, especially with an HTML meta tag, this usually isn't the case.
However, the values of any script variables or object references that were created or set within the first page are not available within the new page.
One other major difference is that because Server.Transfer doesn't require the client to request another page, it can be faster in some cases, depending on what you're doing.
Thursday, May 06, 2004 7:35 AM by Apoorv Bhargava
#
re: Server.Transfer vs. Response.Redirect
Response.Redirect is more user-friendly, as the site visitor can bookmark the page that they are redirected to.
Transferred pages appear to the client as a different url than they really are. This means that things like relative links / image paths may not work if you transfer to a page from a different directory.
Server.Transfer has an optional parameter to pass the form data to the new page.
Since the release version, this no longer works, because the Viewstate now has more security by default (The EnableViewStateMac defaults to true), so the new page isn’t able to access the form data. You can still access the values of the original page in the new page, by requesting the original handler:
Tuesday, May 23, 2006 10:57 AM by Brij Bihari Gupta
#
re: Server.Transfer vs. Response.Redirect
In case of Server.Transfer does not update the clients url history list or current url.
In case of history list is updated to reflect the new address
Friday, August 25, 2006 8:50 AM by GANESH
#
re: Server.Transfer vs. Response.Redirect
Response.redirect: Ex: Response.Redirect("webform1.aspx?id=" & txtfrm2.Text & "") Server.Transfer: Ex: Server.Transfer("webform1.aspx?id=" & txtfrm2.Text & "") Both r similarly same and slightly different. i.e response goes to redirect the value to another page where as tranfer goes to the value thr control also...in asp.NEt
Monday, August 28, 2006 2:46 AM by Vasim Hasmani
#
re: Server.Transfer vs. Response.Redirect
Server.Transfer() : client is shown as it is on the requesting page only, but the all the content is of the requested page. Data can be persist accros the pages using Context.Item collection, which is one of the best way to transfer data from one page to another keeping the page state alive. Response.Dedirect() :client know the physical loation (page name and query string as well). Context.Items loses the persisitance when nevigate to destination page. In earlier versions of IIS, if we wanted to send a user to a new Web page, the only option we had was Response.Redirect. While this method does accomplish our goal, it has several important drawbacks. The biggest problem is that this method causes each page to be treated as a separate transaction. Besides making it difficult to maintain your transactional integrity, Response.Redirect introduces some additional headaches. First, it prevents good encapsulation of code. Second, you lose access to all of the properties in the Request object. Sure, there are workarounds, but they’re difficult. Finally, Response.Redirect necessitates a round trip to the client, which, on high-volume sites, causes scalability problems. As you might suspect, Server.Transfer fixes all of these problems. It does this by performing the transfer on the server without requiring a roundtrip to the client.