Search
Categories
  ASP.NET
Visual C#
Visual Basic
.NET Framework
ADO.NET
AJAX
LINQ
Java
 
How To Rating
 
5.0 out of 5


Total Votes: 4
         
1 2 3 4 5
 




How to Redirect User to Another Page or Website

Author: Waqas Anwar - Posted Date: 08-June-2009 - Category: ASP.NET   
Bookmark and Share
If you want to redirect user to a different page or website from your code behind file, You can use Response.Redirect method which simply sends a message down to the browser, telling it to move to another page.
Response.Redirect("WebForm2.aspx");or
Response.Redirect("http://www.yahoo.com");
You can also use Server.Transfer to conserves server resources because it simply changes the "focus" on the Web server and transfers the request to another page without telling anything to the browser. This means you don't get quite as many HTTP requests coming through, which therefore eases the pressure on your Web server and makes your applications run faster.

Server.Transfer("WebForm2.aspx");
Keep in mind that there are few drawbacks when you are using this technique. First, this method only works with your own website pages, and you cannot redirect user to external website such as www.yahoo.com. Second, this technique doesn’t change the browser URL which can confuse users or can cause problems if user bookmark your page.


LEAVE YOUR COMMENTS LEAVE YOUR COMMENTS
 Name (required)  
 Email (required
 Website


 
POSTED COMMENTS POSTED COMMENTS

Thanks for sharing this one. I am a beginner in using ASP.NET and this one really helps me to learn something new in this prog.language.
Posted by Custom Term Papers on Tuesday, December 15, 2009

 


 
 
 

Categories

My Portfolio

Website Links


Copyright @ 2009 EzzyLearning.com