Response.Redirect Slow as Molasses

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!

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


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 ?????? :)



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
chanterocAuthor Commented:

Thank you much; that was the ticket!

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.