Difference between Response.Redirect() and Server.Transfer() in ASP.Net

What is main Difference between Response.Redirect() and Server.Transfer() method in ASP.Net C#.

The Both Method used to redirect user to new page in ASP.Net.

Response and Server both are the object of ASP.Net Technology.

If we want to go from one web form to other web from in asp.net we can use both Response.Redirect and Server.Transfer.

Response.Redirect(“Pagename.aspx”)

We can use response.redirect to send user to same server or another server.

If we use Response.Redirect method we can finish the whole Round trip and then after send user to another page.
we can use Session()  object with Response.Redirect in ASP.Net
We can not use Context object with Response.Redirect because context object value will be black while page goes to server.

Resonse.redirect can be used both for aspx and html pages.

Response.Redirect(“meera.aspx”);
Response.Redirect(“meera.html”);

In Response.Redirect the browser’s history is updated.

 

Server.Transfer(“Pafename.aspx”)

we can use Server.Transfer to send user to same server web form, we can not send user to other server.

we can use Context with Server.Transfer to send value from one form to another form.

server.transfer is only used for aspx pages it will not work for html pages.
Server.Transfer(“meera.aspx”);

In  Server.Transfer the browser’s history is not updated.

 

What is Context Object in ASP.Net

What is Session Object in ASP.Net

Leave a Reply

Your email address will not be published. Required fields are marked *