Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jul 19, 2007 08:59 AM by FaithRaven
Jul 11, 2007 10:21 PM|LINK
I've deployed a recently started project on 2 IIS 7 free hosting companies, hostmysite.com and maximumasp.com.
I have encountered big loading times on the whole site, but mostly at AJAX parts. For example I have a few cascade drop down lists and it takes 2-3 seconds to populate 1 dropdown with 3-4 listitems when the user selects something in the first dropdown.
On my localhost it happends faster than you blink (E6660, 2 GB RAM).
Have anyone tried out this services ? Its their fault for the big loading times or maybe it's something from my code ? I'm really worried about this and I have no other testing option except this free hosts.♠
Jul 12, 2007 01:48 AM|LINK
Well, how does it run for you in development?
You really need to look at what's slow. Is it your app or is the Internet Connection? Is it latency (ie. startup of the app) or is it request times that are slow.
Hosting sites often have issues with very short Application Pool timeouts that cause the entire app to shut down and are then slow to restart. However, this should not be an issue if you use the site for a number of hits in a row.
+++ Rick ---
Jul 12, 2007 03:40 AM|LINK
I'd recommend you first use something like FireBug (or the IE equivalent) to monitor the network traffic your partial postbacks cause. It sounds like the network traffic is your bottleneck. Especially watch out for huge ViewStates that get uploaded with
every partial postback.
Jul 12, 2007 07:31 PM|LINK
On developing machine it's instant.
I used firebug to do some texts on a page. I have 2 dropdown lists in an update panel and below (outside the update panel) I have a huge gridview. The problem seems to be that gridview's huge viewstate that gets uploaded/downloaded with every partial postback
as gt1329a said.
Now I know the problem. But whats the solution ? Why does the gridview's view state gets uploaded/downloaded everytime even if the gridview is not inside the update panel ?
Jul 12, 2007 08:22 PM|LINK
Unfortunately, the full page's ViewState is sent back and forth on any partial postback. There's no way around that. Though, most of the time there are controls that you can disable ViewState on to minimize it. Or, if you're doing a lot of postbacks,
you might consider rebinding controls on the server side, instead of using ViewState to persist them (viability of this really depends on how your page works).
The other option is that you can use web methods/services to replace some of your heavily used UpdatePanels with JSON communication:
Jul 13, 2007 10:08 AM|LINK
Thanks for all the possibilities you recommended me.
Knowing almost nothing about them all I would also like a suggestion about what method to use. I'm trying to make minimize partial postbacks times because 3 seconds for populating a dropdown list with 5 items it not an acceptable time at all.
Using Web Services seems to most suitable method, but as I said, I know almost nothing about them all so I would like to hear an opinion from someone who knows more than me.
Jul 13, 2007 03:30 PM|LINK
You should attempt to do both. Optimize your ViewState and replace partial postbacks with leaner alternatives when it's possible.
Most controls that are based on form elements can have ViewState eliminated. This is beneficial, even in non-AJAX scenarios, but will especially help cut down on the network footprint of your partial postbacks.
Web Method/Services are great. However, you can't (realistically) use them for anything that needs to modify ViewState. I'd say they're especially well suited to read-only operations that display changing data. A stock ticker, for example. On the other
hand, manipulating a GridView with Web Methods would be tough. For more info on web methods vs. UpdatePanels, take a look at this:
Also, don't forget the AjaxToolkit. For your dropdown, you could use the cascading dropdown extender in the toolkit to do half the work for you (just need to make the web service for it and you're done).
Jul 18, 2007 12:40 AM|LINK
Allright I've used cascadeDropDown extender for my 2 dropdowns and wrote a WS to handle them. The problem is now that depending of the selection I make in the first dropdown I also want to display or hide a label or change it's Text value. This cannot be
done within the WS so I'm back to where I started.
Jul 18, 2007 01:30 AM|LINK
I believe those dropdown extenders fire the normal client side events. So, you could handle EndRequest() to change cosmetics like a text label or div visibility on the client side (or do it on BeginRequest, if you wanted).
Basically, if it's a read-only, cosmetic change, try to do it in client script if you can.
Jul 18, 2007 01:55 AM|LINK
If you are looking for super lightweight grid which support binding data from a web service call try this