当前位置: 动力学知识库 > 问答 > 编程问答 >

asp.net - Setting autopostback to true in itemTemplate in gridview slows down databind

问题描述:

I have an asp grid view. One of the fields is an "ItemTemplate" I bind this dynamically using an in memory datatable and linq to filter this depending on other factors.

If I leave the markup as such

<asp:CheckBox ID="chkSelectSite" runat="server" />

The databind takes about 0.5 seconds for 500ish rows.

If I add

<asp:CheckBox ID="chkSelectSite" runat="server" AutoPostBack="true" />

The same EXACT databind takes roughly 10/15 seconds with no other change to the code. Is there any reason this would be happening or any way to avoid this? I really need to postback on the checkbox to get when the checkedChange is fired for each row in the grid.

分享给朋友:
您可能感兴趣的文章:
随机阅读: