Results 1 to 3 of 3

Thread: How to Redirect From one page to another page in Asp.net

  1. #1
    Join Date
    Dec 2008
    Posts
    13

    How to Redirect From one page to another page in Asp.net

    Hi all,

    In the Asp.net project there is a webpage and i want to redirect this page to the second page. (ie; i want to open a second webform).
    How can i do this ?

  2. #2
    Join Date
    May 2008
    Posts
    2,389

    Re: How to Redirect From one page to another page in Asp.net

    The Response object has a famous Redirect method that is used most widely to transfer a web page visitor from one page to another page.

    Response.Redirect("DestinationPage.aspx")

    There is another famous method called Transfer method of the Server object.

    Server.Transfer("DestinationPage.aspx")

  3. #3
    Join Date
    Jan 2008
    Posts
    1,521

    difference between Server.Transfer and Response.Redirect

    Both "Server" and "Response" are objects of ASP.NET. Server.Transfer and Response.Redirect both are used to transfer a user from one page to another. But there is an underlying difference.

    The Response.Redirect statement sends a command back to the browser to request the next page from the server. This extra round-trip is often inefficient and unnecessary, but this established standard works very well. By the time Page2 is requested, Page1 has been flushed from the server’s memory and no information can be retrieved about it unless the developer explicitly saved the information using some technique like session, cookie, application, cache etc.

    The more efficient Server.Transfer method simply renders the next page to the browser without an extra round trip. Variables can stay in scope and Page2 can read properties directly from Page1 because it’s still in memory. This technique would be ideal if it wasn’t for the fact that the browser is never notified that the page has changed. Therefore, the address bar in the browser will still show “Page1.aspx” even though the Server.Transfer statement actually caused Page2.aspx to be rendered instead. This may occasionally be a good thing from a security perspective, it often causes problems related to the browser being out of touch with the server. Say, the user reloads the page, the browser will request Page1.aspx instead of the true page (Page2.aspx) that they were viewing. In most cases, Response.Redirect and Server.Transfer can be used interchangeably. But in some cases, efficiency or usability may be the deciding factor in choosing.

Similar Threads

  1. Websites redirect to solutioninc’s login page
    By RaAbi in forum Technology & Internet
    Replies: 3
    Last Post: 27-07-2011, 08:42 PM
  2. How to redirect page to print page in Google Chrome?
    By Sahira in forum Technology & Internet
    Replies: 5
    Last Post: 08-03-2010, 11:34 AM
  3. How to redirect a page in JSP
    By Level8 in forum Software Development
    Replies: 5
    Last Post: 26-02-2010, 10:23 PM
  4. Not able to redirect to my home page
    By Flacos in forum Software Development
    Replies: 3
    Last Post: 10-11-2009, 08:22 PM
  5. Unable to redirect to login page
    By Rixwel in forum Windows Software
    Replies: 3
    Last Post: 07-08-2009, 01:27 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,884,231.95439 seconds with 16 queries