2 <%@ Page Language="C#" %>
\r
4 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
\r
6 <script runat="server">
\r
8 protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
\r
10 switch (DropDownList1.SelectedValue)
\r
13 UpdatePanel1.Update();
\r
16 UpdatePanel2.Update();
\r
19 UpdatePanel1.Update();
\r
20 UpdatePanel2.Update();
\r
23 DropDownList1.SelectedIndex = 0;
\r
26 protected void Page_Load(object sender, EventArgs e)
\r
28 ScriptManager1.RegisterAsyncPostBackControl(DropDownList1);
\r
32 <html xmlns="http://www.w3.org/1999/xhtml">
\r
33 <head id="Head1" runat="server">
\r
34 <title>UpdatePanelUpdateMode Example</title>
\r
37 <form id="form1" runat="server">
\r
39 <asp:ScriptManager ID="ScriptManager1"
\r
41 <asp:Panel ID="Panel1"
\r
42 GroupingText="Panel 1"
\r
44 <asp:UpdatePanel ID="UpdatePanel1"
\r
45 UpdateMode="Conditional"
\r
49 UpdatePanel.Update() method is called if this panel is selected
\r
50 to be updated from DropDownList control. Last updated:
\r
51 <%= DateTime.Now.ToString()%>
\r
56 <asp:Panel ID="Panel2"
\r
57 GroupingText="Panel 2"
\r
59 <asp:UpdatePanel ID="UpdatePanel2"
\r
60 UpdateMode="Conditional"
\r
64 UpdatePanel.Update() method is called if this panel is selected
\r
65 to be updated from DropDownList control. Last updated:
\r
66 <%= DateTime.Now.ToString() %>
\r
71 <asp:DropDownList ID="DropDownList1"
\r
73 OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"
\r
75 <asp:ListItem Text="Select a panel to update..."
\r
78 <asp:ListItem Text="Refresh Panel 1"
\r
80 <asp:ListItem Text="Refresh Panel 2"
\r
82 <asp:ListItem Text="Refresh Panel 1 + 2"
\r