Link to home
Start Free TrialLog in
Avatar of rangers99
rangers99

asked on

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

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?

Thanks.
Avatar of cmhunty
cmhunty

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
Avatar of rangers99

ASKER

Hi
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?
ASKER CERTIFIED SOLUTION
Avatar of cmhunty
cmhunty

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial