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
  • 相关阅读:
    CMake入门
    医学图像中的窗宽、窗位
    移动端侧滑
    html5向左滑动删除特效
    同意条款按钮可用
    jquery 日历插件datepicker格式调整
    复选框美化
    select下拉框美化
    单选、复选框判断是否选中
    点击清空文本框中输入的值
  • 原文地址:https://www.cnblogs.com/gwazy/p/798906.html
Copyright © 2011-2022 走看看