.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Response.Redirect slow

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

I'm in the middle of migrating servers and on the new server Response.Redirect is extremely slow. It takes around 20 seconds for the browser to get the redirect. This is something that was quick on the existing server. It's an ASP.NET 2.0 application, both servers are running IIS6.

Additionally, if I "manually" do the redirect, it's fast. For example:

Existing way:


takes around 20 seconds on the new server

New way:

Response.Status = "302 Moved Temporarily";
Response.AddHeader("Location", url);

is fast on the new server.

Any ideas why Response.Redirect would be so slow on the new server?

View Complete Post

More Related Resource Links



I need to open a new window with Response.Redirect, Is it possible?

Adding a cookie to a response.redirect vs. httpWebRequest


Hello, I will try to be as clear as I can be.  I'm sure this question has been asked but I can't find a suitable answer for this particular situation.

I need to be able to redirect the browser to a new 3rd party page while at the same time supplying a cookie required for some form of authentication on the 3rd party site.

I have managed to get this to work in the following manner:


'SessionID is predetermined by another HttpWebRequest/Response  

Dim sessionCookie As New Cookie("ezproxy", sessionID.Substring(1), "/", ".someother.site")

Dim CookieJar As New CookieContainer


rRequest = HttpWebRequest.Create("where I want to go")

rRequest.CookieContainer = CookieJar

rRequest.Method = "GET"


'Make the request and get the response.

rResponse = rRequest.GetResponse()


'Save cookie(s)

If (rResponse.Cookies.Count <> 0) Then

For Each cook

Exit Popup and response.redirect

Hi, I have a requirement to show an Exit Popup on one of our processing pages. I am showing the exit popup by registering a client side javascript like window.onbeforeunload = ShowExitPopUp(); The popup executes fine if you close the window, or try to type in a different URL. However the issue is that my processing page is also performing a "Response.Redirect" on the server side once the process completes. When response.redirect happens the exitpopup also shows up. Is there a way to have the exit popup not show up in that case? Since my server side code is running through an UpdatePanel, so I have tried registering the following, in an attempt to remove ExitPopup from client side. However this doesn't work since server side redirection happens before end request. Sys.WebForms.PageRequestManager.getInstance().add_endRequest(RemoveExitPopup); Has anyone faced a similar situation and handled it?

Response.Redirect("URL") and target="_blank"

in codebehid  I use Response.Redirect(http://www.google.com.hk/) I want the google page is open in a new Win ,did not cove my page, in html we can use target="_blank" How can I hadle it in Redirect? Thank you

What is the difference between Server.Transfer & response.Redirect()

Hello Friends,This is the very favourate question available on every interview questions site.I have searched for it. But didnt get the satisfactory practical difference between these two.Please show me the difference between this two through a working sample demo.Please ilustrate it through a simple sample.

Response.Redirect in new browser window

   protected void ddlPrint_Changed(object sender, EventArgs e)     {         if (ddlPrint.SelectedValue == "All Agenda Items")         {             Response.Redirect(string.Format("{0}?{1}", SettingsRepository.ReportingURL,                                             Utils.EncryptQueryString("ReportName=AgendaItem.rpt")));         }How can I open following report in new browser window using response.redirect? Thx   protected void ddlPrint_Changed(object sender, EventArgs e)    {        if (ddlPrint.SelectedValue == "All Agenda Items")        {            Response.Redirect(string.Format("{0}?{1}", SettingsRepository.ReportingURL,                                            Utils.EncryptQueryString("ReportName=AgendaItem.rpt")));        }}

Response.Redirect in C# for page to page parameter passing

Looking for examples of this, but can't find anything specific. I'm new to ASP.NET, and C# at the same time... so I'm struggling to get it right...  Thanks, Nick


Hi..Is it possible to go to the previous page from wherever we are currently is, using the Response.Redirect()?

Response.Redirect is not working with UpdatePanel

 Response.Redirect is not working with UpdatePanelafter migrating a web site to ASP.NET version 4.please help urgent

Response.Redirect problem in Google Chrome

I'm building an ASP.NET 3.5 webapplication using VB.NET, and I'm having problems redirecting to another URL when using Google Chrome. Other browsers like IE and Firefox are fine.My data entry forms all have an OK and an Cancel button, which are both handled server-side. The Cancel button just redirects back to the originating page, while the OK button will add or update a database record and then redirect to the originating page.The redirect to the originating page is done by calling the following shared sub on a general utilities class in my appication: Shared Sub Redirect(ByVal p_sURL As String) Dim l_sURL As String = p_sURL.ToLower If Left(l_sURL, 1) = "~" Then Dim l_oControl As New System.Web.UI.Control l_sURL = l_oControl.ResolveUrl(l_sURL) End If If Left(l_sURL, 1) <> "/" Then If Left(l_sURL, 7) <> "http://" AndAlso Left(l_sURL, 8) <> "https://" Then l_sURL = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) & wsUtils.SiteRoot & l_sURL End If End If HttpContext.Current.Response.Redirect(l_sURL) 'HttpContext.Current.Response.Redirect(l_sURL, False) End Sub As you can see, I've tried using the extra argument in the Response.Redirect call, but that

SharePoint site response very slow

Hi, We have SharePoint web application. We are hosting it on Windows Sever 2008 along with SQL Server 2008. In the development environment the site works very smoothly. When we deployed the same on our live systems the web application because dead slow. It takes 20-30 mins to load a page and it never let anyone login from a Forms authenticated extention. The windows extention seems to be working fairly decent. I have no clue what is making the site go so slow. Thanks.--Oyshik

Response.Redirect in c# class.

Can you tell me the code of  private void btnnext_Click(object sender, EventArgs e)         {                               }   I am writing response.redirect but then also i am getting error can you plz helpThanks & Regard Aarti.Thakkar (nemo)

Extremely slow Postback or Redirect

I have been coding simple ASP.NET pages for quite a while, but this problem is stumping me. I have a page that is almost purely HTML except for a few ASP.NET buttons and labels - as you can see in the code below. Problem: When I click on a button (that is not set up to do anything) or hit refresh, the page reloads twice at a normal rate and then the third time (and everytime therafter) it takes about 40 seconds to reload. On the first two reloads, some of the images don't always show up (blank placeholders) and sometimes they show a broken link placeholder. If I refresh the page too many times (10 or so) I get: HTTP 403.9 - Access Forbidden: Too many users are connected Internet Information Services When I click on a button that has a response.redirect, it takes 40 seconds to load the page even if it is the first button I have clicked. One of the buttons points to a page that I have not yet created and clicking that button takes 40 seconds to tell me the resource does not exits. Platform: The webpage is running on a Win XP Pro, box with 2GHz, 256RAM and IIS6 and SP2. On the web.config file all I have done is turn off custom errors and turned off debug. I get the same result hitting the page from the webpage server or from different machines. I am the only person hitting the website. I tested putting the page on a different server (XP Server 2003 box

GridView and mouse double click Response.Redirect problem


VS 2005, AJAX 

I use gridview and I need single and double click for each row in gridview.

When I click once on a row, some action will execute (e.g. next button should be enabled) and when I double click the row there should be redirection to another page.

I used the code below for both single and double click  usage:


protected void GwContainers_RowDataBound(object sender, GridViewRowEventArgs e)
                if (e.Row.RowType == DataControlRowType.DataRow)
                    // Get the LinkButton control in the first cell

                    LinkButton singleClickButton = (LinkButton)e.Row.Cells[8].Controls[0];
                    // Get the javascript which is assigned to this LinkButton


IHttpModule OnError Response.Redirect ignored?


Í'm writing an IHttpModule to catch the 404 error:

 public void Init(HttpApplication context)
    context.Error += new EventHandler(OnError);
public void OnError(Object source, EventArgs e)
    HttpContext context = ((HttpApplication)source).Context;

For some reason the Redirect is completely ignored? (the statement is reached and executed when debugging, but nothing happens)

Thanks in advance


Response.Redirect in ASP.NET 4 RC1 and VS 2010 RC1


Hi All,

Recently i upgraded to VS2010 RC1 and ASP.NET 4 RC1.

My old code Response.Redirect("~/iSolutions_Home.aspx") worked perfectly fine even in beta 2, however in RC1 the redirect did this:


and i got the following error:

Bad Request

Server Error in '/WinComm_iSolutions_2010' Application.

HTTP Error 400 - Bad Request.

Version Information: ASP.NET Development Server

Please kindly assist.

Thank you in advance.

Best Regards,



Response.Redirect Holds Other Pages from Loading


Here's the scenario.

I've got a form with a button on it. You have to be logged in to see this form. I use this code to check if the user is logged in and act appropriatley.

Dim isLoggedIn As Boolean = CType(Session("LoggedIn"), Boolean)

        If isLoggedIn = False Then
        End If

The button runs a report that takes anywhere from 0.5 to 20 seconds. For testing it just sleeps for 10 seconds.


The problem is this. Say User1 comes to the form, logs in and runs the report. If User2 comes to the form, the page will not load until User1's report is done.

Now, the bonus is if I comment out the response.redirect line, everything works fine. But if that line is in there I will get this problem.

My quesiton is why is this happening? What's going on in the background that's causing this? Any way around it?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend