界面:
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:Button ID="Button1" runat="server" Text="Button" οnclick="qintianqi" />
<asp:Button ID="Button2" runat="server" Text="Button" οnclick="qintianqi" />
服务器端处理:
protected void qintianqi(object sender, EventArgs e)
{
Button b = sender as Button;
string btid = b.ID;
switch (btid)
{
case "Button1":
Label1.Text = "qintianqi";
break;
case "Button2":
Label1.Text = "zhuguanghuan";
break;
default:
break;
}
}