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

Posted on 2007-10-03
Medium Priority
Last Modified: 2013-11-26
Ive developed a website using Visual Studio 2005. It was written using VisualBasic.net 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
  • 2
LVL 11

Expert Comment

ID: 20006891
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

ID: 20010344
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

cmhunty earned 750 total points
ID: 20014004
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

864 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