Showing posts with label performance. Show all posts
Showing posts with label performance. Show all posts

Saturday, March 24, 2012

DropDownList with many entries is slow when EnablePartialRendering = true, but it is fast

Hello together,

I have a big performance problem when I use a DropDownList in an UpdatePanel. This is my code:

ASPX-Page:

<asp:ScriptManager ID="smMain" runat="server" EnablePartialRendering="true">
</asp:ScriptManager>
<asp:UpdatePanel ID="upPartial" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlList" runat="server" />
<asp:Button ID="btnPostBack" runat="server" Text="PostBack" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="progress" runat="server" DisplayAfter="0">
<ProgressTemplate>
Wait Please...
</ProgressTemplate>
</asp:UpdateProgress>

CodeBehind:

protected void Page_Load(object sender, EventArgs e)
{
for (int i = 0; i < 10000; i++)
{
((DropDownList)this.upPartial.FindControl("ddlList")).Items.Add(new ListItem("Value " + i.ToString(), i.ToString()));
}
}

When I click the button on this page it takes about 1 minute to complete the partial postback. But it is a simple postback with no other code to execute. When I set EnablePartialRendering = false in the ScriptManager the same postback executes in about 1 second.

Can somebody tell me what is the problem with the partial postpack?

Thanks and best regards

Gunther

Hi Gunther,

Well this is an issue that i have seen before on this forum. As far as i know you can't fix this when you take a look at the Ajax framwork. I think that a dropdownlist with 10000 rows isn't a very user friendly dropdownlist. Why are you putting so much items in 1 dropdownlist? Isn't possible to filter some of the items by the selection that a user can make in multiple dropdownlist. For example. If you have a dropdownlist with 10000 projectteams it could be possible to add a few selections before you select the project team like:

Select a Company

Select a Department

Select a Projectteam

This will filter the project team dropdownlist because you first selected a specific company and department so there are less projectteams left. I hope this helps

Regards,


Gunther,

Its not only the problem with the dropdown list, but also with gridview when i has more nubmer of rows.

when i removed the ajax controls, it worked fine.

sansav_p


Thank you for your answers.

The problem is that we are in a production environment, where I can't seperate the filter into several filters and I really need all the entries in the dropdownlist at the moment.

The thing I can't understand is why the page is fast without partial rendering and very very slow with partial rendering. I think I do nothing special and a solution for this should exist. Perhaps it can be solved with a dropdownlist from another vendor.

I will be happy with every solution or help I can get.

DropDownList inside UpdatePanel Performance Issue (IE7 vs. FireFox)

hey,

I have a weird performance issue that i just don't know how to explain:

I built a simple page that has a dropdownlist and a button controls, both of them are inside an update panel.

When a user clicks on the button for the first time, it loads the dropdownlist with 2000 items (just for testing purposes). On the second click, it clears the dropdownlist and fill it with only 2 items. The code is very simple. All in the code behind

I tried the page on IE7 and FireFox. In IE7: the page pauses on the second load (the clear of the 2000 items and the load of the 2 items), while firefox is so much faster.

I removed the update panel and tried the page again, its fast on both IE7 and FireFox. Also tried to add some javascript code to clear the list on the client side, its also too slow.

Does anyone knows a way how to improve it on IE7 :) beside uninstalling it and use FireFox instead :)


thnx 4 ur time

Honestly, I had a lot of performance issues with IE with several of the AJAX controls. We ended up buying a product that is much better than the free one.


i've never seen a dropdownlist that has 2000 items in it before.

what you might want to do is categorizing the items into group(s) and use 2 or more dropdownlist(s). definitely will increase your performance.


Thanks 4 the reply. But its not just about 2000 items, even if you make them 1000 (unfortunately, this is the business logic, that i have to display all the items). Why does FireFox is so much faster, is there something i can do to optimize it.

Thanks