ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

What is the difference between server, transfer and response and redirect?

user-image
تم إضافة السؤال من قبل Asif Ali , Software Engineer , BroadPeak Technologies
تاريخ النشر: 2013/08/06
Shahzad Khan
من قبل Shahzad Khan , Sr. Software Developer , Mar Incorporated

Both methods redirect user to a different page. Response.Redirect does a round trip between browser and server and you are able to see new URL in your browser. Server.Transfer is a server side action where browser is totally unaware of new URL but able to render new page.

Faisal Shah
من قبل Faisal Shah , Senior Web Architect , Innomar Strategies Inc

In addition, there is a slight trick when it comes to AJAX. Response.Redirect can be problematic in that scenario

Anshul Tiwari
من قبل Anshul Tiwari , Software Developer , RTSPL

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.

المزيد من الأسئلة المماثلة