zoukankan      html  css  js  c++  java
  • 客户端入手分析异步更新机制

    aspx
    <%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="6_PartialRenderingMechanism.aspx.cs" Inherits="_6_PartialRenderingMechanism" Title="PartialRenderingMechanism" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        
    <asp:UpdatePanel ID="upChildrenAsTriggers" runat="server" ChildrenAsTriggers="true">
            
    <ContentTemplate>
                
    <%= DateTime.Now %><br />
                
    <asp:Button ID="btnAsyncPostback" runat="server" Text="Async Postback Button" /><br />
                
    <asp:Button ID="btnFullPostback" runat="server" Text="Full Postback Button" /><br />
            
    </ContentTemplate>
            
    <Triggers>
                
    <asp:PostBackTrigger ControlID="btnFullPostback" />
            
    </Triggers>
        
    </asp:UpdatePanel>
        
        
    <br />
        
    <hr />
        
        
    <asp:UpdatePanel ID="upNotChildrenAsTriggers" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
            
    <ContentTemplate>
                
    <%= DateTime.Now %><br />
                
    <asp:LinkButton ID="lbAsyncPostback" runat="server">Async Postback LinkButton</asp:LinkButton>
            
    </ContentTemplate>
            
    <Triggers>
                
    <asp:AsyncPostBackTrigger ControlID="btnOutsideAsyncPostbackButton" />
            
    </Triggers>
        
    </asp:UpdatePanel>
        
        
    <asp:Button ID="btnOutsideAsyncPostbackButton" runat="server" Text="Outside Async Postback Button" />

    </asp:Content>

    cs
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    注意两个触发的按钮
    <
    asp:AsyncPostBackTrigger ControlID="btnOutsideAsyncPostbackButton" /> ,这个会异步更新
    <asp:PostBackTrigger ControlID="btnFullPostback" /> ,这个会引起页面刷新
  • 相关阅读:
    FZU 2105 (线段树)
    HDU 4903 (模拟+贪心)
    Codeforces Beta Round #91 (Div. 1 Only) E. Lucky Array
    HDU 3308 (线段树区间合并)
    POJ 3667(线段树区间合并)
    线段树题集 (cf版)
    HDU 4902 (牛叉的线段树)
    20150204--JS巩固与加强2-01
    20150203+JS巩固与加强1-02
    20150203+JS巩固与加强1-01
  • 原文地址:https://www.cnblogs.com/timy/p/1169881.html
Copyright © 2011-2022 走看看