请高手来帮帮小弟我啊不胜感激!!!!!!!!!!页面一:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Buttom的各种特性1.aspx.cs" Inherits="Buttom的各种特性" %><!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>
    <script language="javascript" type="text/javascript">
    function He()
    {
        alert("hello Asp.net");
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Button ID="Button1" runat="server" Text="显示D1" OnCommand="Button_Command" CommandName="Do1" OnClientClick="He()"  />&nbsp;<asp:Button ID="Button2"
            runat="server" Text="显示D2" OnCommand="Button_Command" CommandName="Do2" /><br />
        <br />
        <asp:Button ID="Button3" runat="server" Text="Button" PostBackUrl="~/Buttom的各种特性2.aspx" OnClick="Button3_Click"/></div>
    </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 Buttom的各种特性 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {    }
    protected void Button_Command(Object sender, System.Web.UI.WebControls.CommandEventArgs e)
    {
        switch (e.CommandName)
        {
            case("Do1"):
                Response.Write("Do1");
                break;
            case("Do2"):
                Response.Write("Do2");
                break;
        }
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        Response.Redirect("Buttom的各种特性2.aspx");
    }
}
//这里演示了Buutton的功能COMMAND和OnClientClick,PostBackUrl
页面2前台:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Buttom的各种特性2.aspx.cs" Inherits="Buttom的各种特性2" %><!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">
    <div>
        <asp:Label ID="Label1" runat="server"></asp:Label><br />
        <br />
        <asp:Label ID="Label2" runat="server"></asp:Label>&nbsp;</div>
    </form>
</body>
</html>
页面2后台:
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 Buttom的各种特性2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Button pp_Bt1;
        Button pp_Bt2;
        pp_Bt1 = (Button)PreviousPage.FindControl("Button1");
        pp_Bt2 = (Button)PreviousPage.FindControl("Button2");
        Label1.Text = pp_Bt1.Text;
        Label2.Text = pp_Bt2.Text;
        
    }
}