How to use multiple UpdatePanel in asp.net ajax

Multiple UpdatePanel in asp.net ajax
UsingMultipleUpdatePanel.aspx

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Drawing" %>

<!DOCTYPE html>

<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        Label1.Text = DateTime.Now.ToLongTimeString();
    }
    protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        Label2.ForeColor = Color.FromName(ListBox1.SelectedItem.Text);
        Label3.ForeColor = Color.FromName(ListBox1.SelectedItem.Text);
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>How to use multiple UpdatePanel in asp.net ajax</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:OrangeRed; font-style:italic;">Ajax UpdatePanel Example: Using Multiple UpdatePanel</h2>
        <hr width="450" align="left" color="Salmon" />
        <asp:ScriptManager 
            ID="ScriptManager1"
            runat="server"
            >
        </asp:ScriptManager>
        <asp:Label 
            ID="Label1"
            runat="server"
            ForeColor="DodgerBlue"
            Font-Size="Medium"
            Font-Bold="true"
            >
        </asp:Label>
        <br /><br />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Label 
                    ID="Label2"
                    runat="server"
                    Text="This Label2 and Triggers both are under UpdatePanel1"
                    Font-Bold="true"
                    Font-Italic="true"
                    Font-Names="Comic Sans MS"
                    Font-Size="Large"
                    >
                </asp:Label>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="ListBox1" EventName="SelectedIndexChanged" />
            </Triggers>
        </asp:UpdatePanel>
        <br />
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate>
                <asp:Label 
                    ID="Label3"
                    runat="server"
                    Font-Bold="true"
                    Font-Size="Large"
                    Text="This is Label3 which is under UpdatePanel2"
                    >
                </asp:Label>
            </ContentTemplate>
        </asp:UpdatePanel>
        <br /><br />
        <asp:ListBox 
            ID="ListBox1"
            runat="server"
            ForeColor="DarkSeaGreen"
            Width="200"
            SelectionMode="Single"
            AutoPostBack="true"
            OnSelectedIndexChanged="ListBox1_SelectedIndexChanged"
            Height="150"
            Font-Bold="true"
            >
            <asp:ListItem>Crimson</asp:ListItem>
            <asp:ListItem>DeepPink</asp:ListItem>
            <asp:ListItem>DarkSeaGreen</asp:ListItem>
            <asp:ListItem>Orange</asp:ListItem>
            <asp:ListItem>Salmon</asp:ListItem>
            <asp:ListItem>DarkSalmon</asp:ListItem>
            <asp:ListItem>OrangeRed</asp:ListItem>
            <asp:ListItem>CornFlowerBlue</asp:ListItem>
        </asp:ListBox>
    </div>
    </form>
</body>
</html>
Related asp.net ajax examples