DCSIMG
Ajax.NET - Independent updating UpdatePanel control - Gilad Lavian's Blog

Gilad Lavian's Blog

In Development

Ajax.NET - Independent updating UpdatePanel control

The problem: When trying to update one UpdatePanel (up1) control next to another UpdatePanel (up2) control, one influences the other and there both triggered.

The solution: Adding Attribute UpdateMode="Conditional" to the UpdatePanel control that you don’t wish to update when triggering the next UpdateControl. Now they will not trigger each other.

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <table width="400" cellpadding="0" border="1" cellspacing="0">
            <tr>
                <td><asp:TextBox runat="server" ID="tb1" /></td>
            </tr>
            <tr>
                <td><asp:Button runat="server" ID="bt1" Text="Submit" /></td>
            </tr>
            <tr>
                <td>
                    <asp:Literal runat="server" ID="ltr1" />
                    &nbsp;<%=DateTime.Now.ToString() %>
                </td>
            </tr>
        </table>        
    </ContentTemplate>
</asp:UpdatePanel>
<br />
<br />
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <table width="400" cellpadding="0" border="1" cellspacing="0">
            <tr>
                <td><asp:TextBox runat="server" ID="tb2" /></td>
            </tr>
            <tr>
                <td><asp:Button runat="server" ID="bt2" Text="Submit" /></td>
            </tr>
            <tr>
                <td>
                    <asp:Literal runat="server" ID="ltr2" />
                    &nbsp;<%=DateTime.Now.ToString() %>
                </td>
            </tr>
        </table>        
    </ContentTemplate>
</asp:UpdatePanel>
שלח תגובה

(שדה חובה)  

(שדה חובה)  

(אופציונלי)

(שדה חובה) 

Please add 1 and 5 and type the answer here:


Enter the numbers above: