Response.Redirect :
Server.Transfer :
- It sends an HTTP request to the browser,then the browser sends the request to the server,then the server deliver a response to the web browser.
- This method can be used for both .aspx and Html pages.
- This method can be used to redirect a user to an external website.
- While using Response.Redirect method,the previous page is removed from server memory and load a new page in memory.
- Address of the URL will be changed along with the content.
- This method also update history of the browser
- This method sends request directly to the web server and web server delivers the response to the browser.
- By using this method we get same URL but with different content that means web page URL in the address bar will not changed.
- It can only used for .aspx page and is specific to ASP.NET
- While using Server.Transfer the previous page also exits in server memory.
- It can be used only on sites running on the same server. we can not use to redirect the user to a page running on a different server.
Syntax for Both :
Response.Redirect ("Default.aspx");
Server.Transfer("Default.aspx");


0 comments:
Post a Comment