Why does my ASP.NET website take so long to process user data?

Posted on 2007-10-03
Last Modified: 2013-11-26
Ive developed a website using Visual Studio 2005. It was written using and ASP.NET 2.0
One of the pages contains 2 text boxes. In the first box the user inputs information. When he/she clicks a button this information is sent to the server where it is processed. An answer is then returned which is displayed in the 2nd text box.

The size of the information sent to the server is quite large. Around 100K of text information. And 100K of information (the answer)  is returned.

Now Ive been doing some timings. After clicking the button the first time it takes 15 seconds for the answer to appear in the 2nd text box. If I click the button again it takes 45 seconds to return the answer. In fact it takes 45 seconds for all times after this UNLESS I do a refresh in which case it takes 15 seconds again. Can anyone explain what is happening here? I assume the solution is to somehow simulate a page refresh from code before (or after?) I receive the answer? How do I do this?

Question by:rangers99
    LVL 11

    Expert Comment

    Ensure that you have viewstate switched off on all controls where it's not required. You probably wouldn't need it on the answer textbox for example.

    If you view source before and after clicking the button, you can get an idea on whether the problem is a viewstate one if it has grown significantly

    Author Comment

    Thanks. I tried that and its certainly speeded things up a bit. 12 seconds the first time but double that, 24 seconds, the 2nd time.

    I set enableviewstate to false for both text boxes. I read a bit about this and it seems the contents of textboxes are posted back whatever enableviewstate is set at!? So Im a bit confused as to why this has made a difference.

    However if the Answer text box is set to "" before I press the button then the time is 12 seconds. So this is the problem.  I tried setting the value of this box to ""  in the button's code-behind but this doesnt work not surprisingly. Do you know how I can do this?
    LVL 11

    Accepted Solution

    Sorry, I'm not sure what the question is now?

    One other thing I was wondering was why is there 100kb being transferred to the server on pressing the button. Do you need to transfer all of that data? Is the server on the same network as the web server? If it goes over the internet, obviously, this will add extra time

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    This video discusses moving either the default database or any database to a new volume.

    759 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

    10 Experts available now in Live!

    Get 1:1 Help Now