Response.Redirect Slow as Molasses

Posted on 2004-11-09
Last Modified: 2008-01-09
Hello all,

I'm running into an issue which for the moment is more of an annoyance than anything else, but I was hoping you might shed some light on why it's happening.

I have a Web Form that does nothing other than display a log file in a pre tag's innner text. The page pulls in the contents of the log file just fine, but when the user clicks on the LinkButton, which should return the app to the Main Menu, the page appears to hang and then times out after 90 seconds or so.

Page code follows:

using RCP.Utilities;
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.IO;
using System.Web.UI.WebControls;

namespace RCP
      /// <summary>
      /// Summary description for RecordsCenters.
      /// </summary>
      public class ProcessViewLog : System.Web.UI.Page
            #region Variables and Controls

            protected Footer ucFooter1;
            protected Footer ucFooter2;
            protected AdminHeader ucAdminHeader;
            protected System.Web.UI.HtmlControls.HtmlForm Form1;
            protected System.Web.UI.WebControls.Label lblLogFile;
            protected System.Web.UI.WebControls.Label lblHeader;
            protected System.Web.UI.HtmlControls.HtmlGenericControl preLogFile;

            #region Page_Load()

            private void Page_Load(object sender, System.EventArgs e)
                  if (! IsPostBack)
                        lblLogFile.Text = AdminProcess.GetLastProcessLog();

                        if (File.Exists(@lblLogFile.Text))
                              string @tempFile = ConfigurationSettings.AppSettings["RootFolder"] + "temp.log";
                              File.Copy(@lblLogFile.Text, @tempFile, true);
                              StreamReader fs = new StreamReader(@tempFile);
                              preLogFile.InnerText = fs.ReadToEnd();
                              preLogFile.InnerText = "The Log File " + @lblLogFile.Text + " was not found.";


            #region Web Form Designer generated code
            override protected void OnInit(EventArgs e)
                  // CODEGEN: This call is required by the ASP.NET Web Form Designer.
            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            private void InitializeComponent()
                  this.Load += new System.EventHandler(this.Page_Load);



Many thanks!

Question by:chanteroc
    LVL 10

    Accepted Solution


    Your log file isn't getting held in the viewstate is it? If it is then disable it for preLogFile as you may be posting this back to the server. Other that that ?????? :)



    Author Comment


    Thank you much; that was the ticket!


    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now