Showing posts with label load. Show all posts
Showing posts with label load. Show all posts

Saturday, March 24, 2012

CascadingDropDown slow to load in IE7?

I have a cascading dropdown that loads about 13,000 items from a PageMethod. In Firefox 2 this takes just under 5 seconds, but the same page in IE7 is taking about 160 seconds to load the same dropdown! IE response to using that page is also slow once it has loaded.

If I populate the dropdown server-side by binding a datasource directly to the control is takes a while to render the page but nowhere near 2.5 minutes.

Code example:

HTML:

<asp:dropdownlist id="ddlAlert" runat="server" width="100%"></asp:dropdownlist>
<ajt:CascadingDropDown ID="cddAlerts" runat="server" TargetControlID="ddlAlert" Category="Alert" ServiceMethod="GetAlerts" LoadingText="Loading alerts..." />
Code Behind:
 <System.Web.Services.WebMethod()> _
<System.Web.Script.Services.ScriptMethod()> _
Public Shared Function GetAlerts(ByVal knownCategoryValuesAs String,ByVal categoryAs String)As CascadingDropDownNameValue()
Dim retValAs New Collections.Generic.List(Of CascadingDropDownNameValue)
retVal.Add(New CascadingDropDownNameValue("All Alerts","0",True))
Dim appAs New MOAE.MOAE
Dim dsAs DataSet = app.GetAlertProfiles
Try
For Each rowAs DataRowIn ds.Tables(0).Rows
retVal.Add(New CascadingDropDownNameValue(row("AlertDisplayName").ToString, row("AlertProfileID").ToString))
Next
Catch exAs Exception
app.LogWarning(ex, Diagnostics.EventLogEntryType.Error)
End Try ds =Nothing app =Nothing
Return retVal.ToArray
End Function

Does anyone have any way of speeding this up? Is this just down to IE's Javascript engine?

Cheers,
Nick

I know this isn't the answer you want to hear, but as a user I would cringe at a dropdown containing 13k items. How would I ever find the item I'm looking for. Isn't there a better design implementation?

I don't know but I could certainly see IE having a heart attack with a 13k dropdown and that would account for the slow page. Might not be completely fixable if that's the case...


It's the conclusion I had come to as well but I was curious at the disparity in speed between Firefox's and IE's implementation of this....


Hi Nickfoster,

IE7 and Firefox are have their own merits. Some tests show that Firefox do better job on string processing. But I am quite agree with Noahb, we should limit its items in your case.

Best regards,

Jonathan

Wednesday, March 21, 2012

CascadingDropDown load times with large amounts of data

Greetings,

I am a relative newcomer to ASP.Net AJAX. So hopefully the answer to this question will be quick and easy.

I've created a CascadingDropDown list that gets store locations based on the company. In some of these datasets there are as many as 6,000 - 10,000 records that need to be loaded into the TargetControl. This ends up being quite a lot of data. I was having problems with this origanally because of the default maxJsonLength in my webconfig which I've now corrected.

The TargetControl now gets loaded and it works with this one exception: For queries with exceptionally large datasets the client is taking up to 30 seconds or more to load the target control. I did caching on the server side in the webservice to cache data sets and that doesn't seem to be the problem. I've done some analysis with Fiddler v2.0 and it appears that the round trip request/response is taking only about a 5th of a second (see capture below):

Request Count: 1
Bytes Sent: 545
Bytes Received: 701,964

ACTUAL PERFORMANCE
-----
Requests started at: 13:58:38:1621
Responses completed at: 13:58:38:3496
Total Sequence time: 00:00:00.1875024

RESPONSE CODES
-----
HTTP/200: 1

RESPONSE BYTES (by Content-Type)
-----
~headers: 239
application/json: 701,725

So the question is: why does it take the CascadeDropDown control so long to load the data? What is client doing for the other 29.8124976 seconds?

When I did this web app in ASP.Net 2.0 (without AJAX), it was taking 2- 3 seconds max for these large data sets to load doing direct databasecalls.

Any help would be appreciated.

Thanks,

Scott Lance
Application Developer
Children's Miracle Network

I have the same problem in my application. Large sets of data are not uncommon in the large applications.

Can anybody, please, take a look at this

CascadingDropDown items limited (Error) ??

Hello people,

I have a big problem with CDD, try to load a large amount of items, for example.

In the sample of CDD change the webservice "CarsService" method "GetDropDownContents",
insert this code:

for (int i = 0; i < 870; i++)
{
values.Add(new CascadingDropDownNameValue(string.Format("Name{0}",i), string.Format("Value{0}",i)));
}

and the Method Erro 500 show ...

my list are 890 items

Please Help...!Idea

What is the exact error you are getting? Is it possible to figure out at what exact number of items cdd starts to error out?

Also, what is the scenario in which you need to have so many items in a cdd? From a usability point of view it does not seem very appropriate.


Try:http://ajax.asp.net/docs/mref/P_System_Web_Script_Serialization_JavaScriptSerializer_MaxJsonLength.aspx

Thank you so much for your response...

Solve my problem perfect...Yes

Big Smile