Atlas UpdatePanel代码简介

<html >
<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显示的内容)更新但是不刷新!

posted @ 2006-09-29 10:15  chy710  阅读(492)  评论(0编辑  收藏  举报