---
title: "Server.Transfer: how use it"  
description: "Server.Transfer Passing data from onepage to another we use Server.Transfer and other method. Server.Transfer isprovide more efficient result as compa"  
author: "Amit Singh"  
published: 2010-10-31  
updated: 2014-09-18  
canonical: https://www.mindstick.com/blog/38/server-transfer-how-use-it  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 2 minutes  

---

# Server.Transfer: how use it

##### Server.Transfer

[Passing data](https://www.mindstick.com/interview/34053/passing-data-into-components-in-knockout) from onepage to another we use [Server.Transfer](https://www.mindstick.com/interview/1828/what-is-the-difference-between-server-transfer-and-response-redirect) and other method. Server.Transfer isprovide more efficient result as [comparison](https://www.mindstick.com/articles/23182/comparison-maruti-suzuki-celerio-v-s-tata-tiago) to other.

“The Page representing the page thattransferred control to the current page.”\
\
When you use the Transfermethod or use cross-page posting totransfer processing from one ASP.NET page to another, the originating pagecontains request information that might be required for the [destination](https://yourviews.mindstick.com/story/1451/gorgeous-locations-for-destination-weddings-in-india) page.You can use the PreviousPageproperty to access that information.

##### How use the Server.Transfer

##### Forexample

##### Step 1:

We add the onepage as Default1.aspx and add one TextBox and Button and write this code onbutton click

```
protected voidButton1_Click(object sender, EventArgs e)    {       Server.Transfer("Default2.aspx");    }
```

##### Step2:

We access the [textbox control](https://www.mindstick.com/articles/320/textbox-control-in-vb-dot-net) data on this current page,we write the this code on [page load](https://www.mindstick.com/articles/12909/how-to-open-first-time-popup-on-page-load-in-website)

```
protected voidPage_Load(object sender, EventArgs e)    {        TextBox txt = (TextBox)Page.PreviousPage.FindControl("TextBox1");        Label1.Text =txt.Text;    }
```

So, we access the previous page data very fast as comparisonto response.redirect. so it one important method “to [pass the data](https://answers.mindstick.com/qa/33498/how-do-you-pass-the-data-to-sub-activities-android-explain-for-example) from [one page](https://www.mindstick.com/forum/118/problem-in-display-content-of-one-page-to-another-page) to another”.Server.Transferacts as an efficient [replacement](https://www.mindstick.com/forum/160229/timing-belt-replacement-cost-guide-everything-you-need-to-know) for the Response.Redirect method.Response.Redirect specifies to the browser to request a different page. Becausea redirect forces a new page request, the browser makes two requests to the Webserver, so the [Web server](https://www.mindstick.com/articles/23199/digital-personal-server-the-premium-web-server) handles an extra request.

---

Original Source: https://www.mindstick.com/blog/38/server-transfer-how-use-it

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
