📄 button.aspx.cs
字号:
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 backup_button : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
public void Button_Click(object sender, CommandEventArgs e)
{
string argName = e.CommandName;
//CommandEventArgsr为一个类,故CommandArgument.ToString();
string argArg = e.CommandArgument.ToString();
Label2.Text = "您选中的为:<font color=red>" + argName + "</font>,带的数据是:<font color=red>" + argArg + "</font>";
}
protected void Button_Click(object sender, EventArgs e)
{
string argName = ((Button)sender).CommandName;
//sender为一个对象,故CommandArgument为string
string argArg = ((Button)sender).CommandArgument;
Label1.Text = "您选中的动作为:<font color=red>" + argName + "</font>,带的数据是:<font color=red>" + argArg + "</font>";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -