Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is difference between response.redirect and
server.transfer ?

Answers were Sorted based on User's Feedback



What is difference between response.redirect and server.transfer ? ..

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

What is difference between response.redirect and server.transfer ? ..

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

Post New Answer

More ASP.NET Interview Questions

How do you a replicate a set of controls across a number of ASP Pages

2 Answers  


Can you explain what inheritance is and an example of when you might use it?

4 Answers   Siebel Systems,


How to disable validator control by client side JavaScript?

0 Answers  


What are the different ways you would consider sending data across pages in ASP (i.e between asp to asp)?

0 Answers  


What is Razor View Engine

0 Answers   HCL,


What is microsoft windows sharepoint services?

0 Answers  


What is the default Orientation property in a Menu control?

0 Answers   Sans Pareil IT Services,


Asp.net and asp ? differences?

2 Answers  


If i have 1000 records in dataset, how to do paging?

2 Answers   Mind Tree,


How does SQL Server session state works

1 Answers   Emphasis,


what is clr .

1 Answers   Patni,


For a server control, you need to have same properties like color maxlength, size, and allowed character throughout the application. How do you handle this?

2 Answers   Microsoft,


Categories