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

No comments:

Post a Comment