button3_cs.aspx

来自「一些标准控件的举例说明」· ASPX 代码 · 共 58 行

ASPX
58
字号
<html>
<head>

    <script language="C#" runat="server">

       void Button1_Click(object s, EventArgs e) {
          Label1.Text="You clicked Button1";
       }

       void Button2_Click(object s, EventArgs e) {
          Label1.Text="You clicked Button2";
       }

    </script>

</head>
<body>

    <h3><font face="Verdana">Mouse-Over Effects on Button</font></h3>
    <p>Move your mouse over the buttons to observe the mouse-over effects.</p>
    
    <form runat=server>
    <font face="Verdana" size="-1">

        <asp:Button id=Button1 runat="server"
            Text="Button1"
            Width="100px"
            onmouseover="this.style.backgroundColor='yellow'"
            onmouseout="this.style.backgroundColor='buttonface'"
            onclick="Button1_Click" />

            &nbsp;&nbsp;
            Applies an inline CSS style (button background color)...

        <p>

        <asp:Button id=Button2 runat="server"
            Text="Button2"
            Width="100px"
            onmouseover="this.style.fontWeight='bold'"
            onmouseout="this.style.fontWeight='normal'"
            onclick="Button2_Click" />

            &nbsp;&nbsp;
            Applies an inline CSS style (button font bold)...

        <p>
        
        <asp:Label id=Label1 runat=server />
        
    </font>
    </form>

</body>
</html>


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?