zoukankan      html  css  js  c++  java
  • asp.net ajax UpdatePanel 的使用



    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        
    <title>无标题页</title>
    </head>
    <body>
        
    <form id="form1" runat="server">
      
    <asp:ScriptManager ID="ScriptManager" runat="server" EnablePartialRendering="true" />

    <!-- Step 2: Wrap our existing code in an "UpdatePanel" -->
    <asp:UpdatePanel ID="TimeStampPanel" runat="server">
       
    <ContentTemplate>
           
    <asp:Button ID="UpdateButton" runat="server" Text="Update" />
           
    <asp:TextBox ID="TimeStampTextBox" runat="server" />
       
    </ContentTemplate>
    </asp:UpdatePanel>

        
    </form>
    </body>
    </html>


    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;

    public partial class Default2 : System.Web.UI.Page
    {
        
    protected override void OnInit(EventArgs e)
        
    {
            
    this.UpdateButton.Click += delegate
            
    {
                
    this.TimeStampTextBox.Text = DateTime.Now.ToLongTimeString();
            }
    ;
        }

        
    protected void Page_Load(object sender, EventArgs e)
        
    {

        }

    }

    参考
    http://ajax.asp.net/docs/tutorials/IntroductionUpdatePanel.aspx
  • 相关阅读:
    Struts2 拦截器
    Struts2 常用标签
    Struts2 OGNL表达式、ValueStack
    Struts2 在Action中操作数据
    Struts2 动态方法调用
    Struts2 常量配置
    Struts2 struts.xml配置
    Struts2 Action的3种创建方式
    Struts2 运行流程
    JUnit
  • 原文地址:https://www.cnblogs.com/gwazy/p/798906.html
Copyright © 2011-2022 走看看