<%@ Import Namespace="System.Data"%>
<%@ Import Namespace="System.Web"%>
<%@ Import Namespace="System.Web.UI"%>
<%@ Import Namespace="System.Web.UI.WebControls"%>
===去掉上面这些也可以===
<script runat="server" language="C#">
void a_OnClick(object sender, System.EventArgs e)
//注意,这里写成 object sender,EventArgs e 就出错了
{
btnCounter.Text = "已经点击";
}
</script>
<html>
<head>
<title>按钮</title>
</head>
<body>
<form runat="server">
<asp:Button Text="没人点击" OnClick="a_OnClick" id="btnCounter" runat="server"/>
</form>
</body>
</html>