Atlas UpdatePanel代码简介
点击次数:32 次 发布日期:2008-11-26 12:01:17 作者:源代码网
|
源代码网推荐 <head runat="server"> 源代码网推荐 <title>Atlas之UpdatePanel</title> 源代码网推荐 </head> 源代码网推荐 <body> 源代码网推荐 <form id="form1" runat="server"> 源代码网推荐 <!-- 引入Atlas类库 --> 源代码网推荐 <atlas:ScriptManager ID="m1" runat ="server" EnablePartialRendering="true" ></atlas:ScriptManager> 源代码网推荐 <!-- 普通.net控件 --> 源代码网推荐 <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"> 源代码网推荐 <asp:ListItem>1</asp:ListItem> 源代码网推荐 <asp:ListItem>2</asp:ListItem> 源代码网推荐 </asp:DropDownList> 源代码网推荐 <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /><br /> 源代码网推荐 <!-- 数据提交时出现提示等待状态 --> 源代码网推荐 <atlas:UpdateProgress ID="ps" runat ="server" > 源代码网推荐 <ProgressTemplate > 源代码网推荐 数据加载中... 源代码网推荐 </ProgressTemplate> 源代码网推荐 </atlas:UpdateProgress> 源代码网推荐 <!-- 需要动态更新的部份放到updatepanle里面(更新不刷新) --> 源代码网推荐 <atlas:UpdatePanel ID="p1" runat ="server" > 源代码网推荐 <!-- 更新部分内容 --> 源代码网推荐 <ContentTemplate > 源代码网推荐 <asp:Label ID="Label1" runat="server"></asp:Label> 源代码网推荐 </ContentTemplate> 源代码网推荐 <!-- 更新条件 --> 源代码网推荐 <Triggers> 源代码网推荐 <!-- 控件的某个值改变 --> 源代码网推荐 <atlas:ControlValueTrigger ControlID ="DropDownList1" PropertyName ="SelectedValue" /> 源代码网推荐 <!-- 控件的某个事件激发 --> 源代码网推荐 <atlas:ControlEventTrigger ControlID ="Button1" EventName ="Click" /> 源代码网推荐 </Triggers> 源代码网推荐 </atlas:UpdatePanel> 源代码网推荐 </form> 源代码网推荐 </body> 源代码网推荐 </html> 源代码网推荐 源代码网推荐 此代码实现的效果:改变DropDownList1选项或单击Button1后页面(这里仅是Label1显示的内容)更新但是不刷新! 源代码网推荐 做人要厚道,请注明转自酷网动力(www.ASPCOOL.COM)。 源代码网推荐 源代码网供稿. |
