zoukankan      html  css  js  c++  java
  • ATLAS学习UndatePanel

         <script language="c#">
        protected void Button2_Click(object sender, EventArgs e)
        {

            this.textbox1.Text = DateTime.Now.ToString();
        }
    </script>

       <atlas:ScriptManager ID="ScriptManager1" runat="server"   EnablePartialRendering="true"/>
           
            <atlas:UpdatePanel ID="UpdatePanel1" runat="server" Mode="Conditional" RenderMode="inline">
                <Triggers>
                    <atlas:ControlEventTrigger  ControlID="Button1" EventName="Click"/></Triggers>
                    <ContentTemplate>
                        <asp:TextBox ID="textbox1" runat="server" ></asp:TextBox>
                    </ContentTemplate>
            </atlas:UpdatePanel>
           <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="click" />



    执行这段程序,点击Button1后,文本框中的内容呈现为当前的时间。
    UpdatePanel控件用放置需要更新或改变的控件,
    UpdatePanel控件内可包含多个<Triggers>标记,但只能包含一个<ContentTemplate>标记
    其中的<Triggers>标记的ControlEventTrigger的ControlID指改变textbox1的控件ID(这里应填写textbox1),EventName应填入控件所触发的事件名,这里的事件名等同于控件本身的事件名称
    在<ContentTemplate>内放置要改变的控件。

    Mode属性的设置

    The Mode property specifies when the UpdatePanel refreshes its contents. If the Mode property is set to Always, the contents of the panel are refreshed during every postback. If the Mode property is set to Conditional, the panel is rendered on the server based on one or more triggers, such as when specified property values change or when specified events occur. This optimizes the markup sent to the client during postback.



     

  • 相关阅读:
    AJAX补充
    JQuery知识补充2
    JQuery知识补充1
    LiveBOS使用指南
    HTML5(1)
    .net 后台导出excel ,word
    Eval绑定方法:多条件绑定:
    repeater 的用法
    两个页面地址栏传值
    js取后台的值
  • 原文地址:https://www.cnblogs.com/stswordman/p/404472.html
Copyright © 2011-2022 走看看