What is difference between response.redirect and
server.transfer ?
Answers were Sorted based on User's Feedback
Answer / skmdali786
This is one of the favorite questions in ASP.NET Interviews.
Every interviewer would like to know from the .NET candidate
two things, how they differ technically and which scenarios
should we use them.
Technical difference :- In Response.Redirect the following
steps happen :-
1 - Client browser sends a signal to the server that he
wants to go to xyz.aspx.
2 - Server responds back to the browser about the location
of xyz.aspx and tells the client to go to that location.
3- Client gets the response and redirects to xyz.aspx.
In server.transfer the the following step happens :-
1 - Client browser sends a signal to the server that he
wants to go to xyz.aspx.
2 - Server redirects to xyz.aspx and send the output to the
client.
In other words in response.redirect there is a round trip
while in server.transfer there are no round trips.
The next question what interviewer will ask is so does that
mean we should always use server.trasfer and
response.redirect is never needed.
Both of the are useful under different scenarios.
Response.redirect is good when we want to go cross domains ,
in other words you want to redirect from www.questpond.com
to www.microsoft.com. Server.trasfer do not work when you go
cross domains.
| Is This Answer Correct ? | 8 Yes | 1 No |
Answer / minhajul islam
1. Redirect can redirect to outside page while Transfer can
use page only in the same project.
Example : Redirect("www.yahoo.com") while transfer can
only inside current project page.
2. Redirect does not transfer content of the page while
Transfer transfers controls of current to transferred page.
For example if we use Multi-Page form and need to access
components of each page then we can use Transfer but must
use CrossPagePostBack.
| Is This Answer Correct ? | 1 Yes | 0 No |
What asp.net control can embed xaml into asp.net pages?
What are different types of api?
Define the steps to set up validation control.
what is Master pages in asp.net? what is the advantages and disadvantages?
In asp.net, if a webpage seems too slow to load completely in th ebrowser. In this case what are the checkings or actions you will take to rectify the slowness or which are the factors related to this issue? How we can trace it?
Are cookies client side or server side?
How do we access view state value of this page in the next page?
Is asp.net and .net same?
Can you explain composite pattern?
What tags do you need to add within the asp:datagrid tags to bind columns manually? Give an example.
What is the full form of asp.net?
Which type of state management is provided by Query String in ASP.NET?
0 Answers Sans Pareil IT Services,
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)