<%--前台--%>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication3.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="textbox1" runat="server" OnTextChanged="textbox1_TextChanged" AutoPostBack="true"></asp:TextBox>
<asp:TextBox ID="textbox2" runat="server"></asp:TextBox>
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</div>
<asp:UpdatePanel ID="uid" runat="server">
<ContentTemplate>
<div>
<asp:Button ID="Button1" runat="server" Text="异步回送" OnClick="Button1_Click1" />
<asp:Button ID="Button2" runat="server" Text="整页回送" OnClick="Button2_Click" /><br />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="197px">
<Columns>
<asp:BoundField DataField="au_lname" FooterText="aaaa" HeaderText="au_lname" />
</Columns>
</asp:GridView>
<br />
<asp:Label ID="Label1" runat="server" Text="当前时间" Font-Bold="True" Font-Size="Large"></asp:Label>
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" />
<asp:PostBackTrigger ControlID="Button2" />
</Triggers>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
protected void Button1_Click1(object sender, EventArgs e)
{
DataTable dt = new DataTable();
dt.Columns.Add("au_lname");
for (int i = 0; i < 10; i++)
{
DataRow dr = dt.NewRow();
dr["au_lname"] = i.ToString();
dt.Rows.Add(dr);
}
this.GridView1.DataSource = dt.DefaultView;
this.GridView1.DataBind();
}
protected void Button2_Click(object sender, EventArgs e)
{
this.Label1.Text = DateTime.Now.ToString();
}