Update panel problem

Posted by ram on Stack Overflow See other posts from Stack Overflow or by ram
Published on 2010-04-07T05:47:14Z Indexed on 2010/04/07 5:53 UTC
Read the original article Hit count: 330

Filed under:
|

Here is my code:

<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" ChildrenAsTriggers="false" runat="server">
            <ContentTemplate>
                <asp:Button ID="Button1" runat="server" Text="Click1" OnClick="Button1_Click" />
                <br />
                <br />
                Last refresh
                <%=DateTime.Now.ToString() %>
                <br />
                <br />
                <asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" ChildrenAsTriggers="true" runat="server">
                    <ContentTemplate>
                        <asp:Button ID="Button2" runat="server" Text="Click2" OnClick="Button2_Click" />
                        <br />
                        <br />
                        Last refresh
                        <%=DateTime.Now.ToString() %>
                        <br />
                        <br />
                    </ContentTemplate>
                     <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Button2" EventName="Click" />
            </Triggers>
                </asp:UpdatePanel>
            </ContentTemplate>
             <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
    </form>
</body>

Im using two update panels here, when i click "Button2" then "UpdatePanel2" was refreshed, if i click "Button1" then both update panel were refreshed, but my need is if i click "Button1" then "UpdatePanel1" have to be refreshed.

Thanks.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about updatepanel