Passing data from onepage to another we use Server.Transfer and other method. Server.Transfer isprovide more efficient result as comparison to other.
“The Page representing the page thattransferred control to the current page.”
How use the Server.Transfer
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)
We access the textbox control data on this current page,we write the this code on page load
protected voidPage_Load(object sender, EventArgs e)
TextBox txt = (TextBox)Page.PreviousPage.FindControl("TextBox1");
So, we access the previous page data very fast as comparisonto response.redirect. so it one important method “to pass the data from one page to another”.Server.Transferacts as an efficient replacement 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 handles an extra request.