📄 button.aspx
字号:
<html>
<head>
<script language="C#" runat="server">
void CommandBtn_Click(Object sender, CommandEventArgs e) {
//参数e是CommandEventArgs类型,表明按钮是Command类型
//读出CommandArgument信息,并赋给Label控件
Label1.Text=(String)e.CommandArgument;
}
</script>
</head>
<body>
请选择您要购买的笔记本:<p>
<form runat=server>
<asp:Button id="Button1"
Text="Dell"
onmouseover="this.style.backgroundColor='yellow'"
onmouseout="this.style.backgroundColor='buttonface'"
CommandName="dell"
CommandArgument="dell"
onCommand="CommandBtn_Click"
runat="server"/>
<asp:Button id="Button2"
Text="IBM"
onmouseover="this.style.backgroundColor='lightgreen'"
onmouseout="this.style.backgroundColor='buttonface'"
CommandName="IBM"
CommandArgument="IBM"
onCommand="CommandBtn_Click"
runat="server"/>
<p>
您选择了:<asp:Label id=Label1 runat=server />
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -