<%@ Page Language="C#" %>
<script runat="server">
    protected void Button1_Click(object sender, EventArgs e)
    {
        lblmes.Text = DateTime.Now.ToString();
        lblmes.ForeColor = System.Drawing.Color.Red;
        lblmes.Font.Bold = true;
    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Ex2-1</title>
</head>
<body>
<form id="form1" runat="server">
    <div>
        注意查看显示效果：
        <asp:Label ID="lblmes" runat="server" Text="Label控件内容"></asp:Label><br />
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="改变内容"/>
    </div>
</form>
</body>
</html>