Search code examples
asp.netupdatepanel

Asp.net page still flickers with UpdatePanel


I have a page which contains a Listview,. The ItemTemplate will contain many Checkboxes for each returned value from it's datasource. These Checkboxes has a OnCheckedChanged function and when a user selects the checkbox, the page flickers...I have investigated UpdatePanels, but to no avail. Also, this page contains a MasterPage.

Code:

    <asp:UpdatePanel ID="UpdatePanel2" runat="server">
    <ContentTemplate>
        <asp:ListView ID="lvTypes" runat="server" DataSourceID="XXX" GroupItemCount="4">
           <ItemTemplate>
             <td style="background-color: #4b6c9e;" align="left">
                 <asp:CheckBox ID="Type" runat="server" Text='<%# Eval("Type") %>'  ForeColor="White"  OnCheckedChanged="chk_CheckedChanged" AutoPostBack="True" CssClass="myCheck" Font-Size="45px" />
             </td>
                ...
                ...
                ...

Obviously, I am not grasping the concept of the UpdatePanel. Can you direct me on how to implement this for this scenario"? Thanks.


Solution

  • If you use UpdateMode = "Conditional" it'll do a partial refresh.

    <asp:UpdatePanel ID="UpdatePanel2" UpdateMode = "Conditional" runat="server">
    

    Read MSDN to get an idea of the UpdatePanel control.

    And, also have a look at this comprehensive explanation in MSDN