Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/326.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ASP.net c#按钮单击_C#_Asp.net_Onclick_Buttonclick - Fatal编程技术网

ASP.net c#按钮单击

ASP.net c#按钮单击,c#,asp.net,onclick,buttonclick,C#,Asp.net,Onclick,Buttonclick,鉴于: 如果我将其分配给输入,它不会显示所有效果。更改CSS-问题不在于asp.net,而在于样式表。在样式表中的“button”之后粘贴“input”其实并不难,元素将被转换为代码中的实例。该类公开一个服务器端事件,您可以将其用于以下目的: input[type=button], button { font-family: arial, sans-serif; font-size: 12px; font-weight: bold; margin: 0px;

鉴于:


如果我将其分配给输入,它不会显示所有效果。

更改CSS-问题不在于asp.net,而在于样式表。在样式表中的“button”之后粘贴“input”其实并不难,
元素将被转换为代码中的实例。该类公开一个服务器端事件,您可以将其用于以下目的:

input[type=button], button {
    font-family: arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
    margin: 0px;
    padding: 5px 20px 5px 20px;
    outline-width: 0;
    border: 1px solid #000;
    border-radius: 7px;
    -moz-border-radius: 7px;
    -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5);
    -moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5),
        inset 0px 1px 0px rgba(255, 255, 255, 0.5);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5),
        inset 0px 1px 0px rgba(255, 255, 255, 0.5);
    -webkit-transition: background-color 0.2s ease-in-out,
        color 0.2s ease-in-out,
        -webkit-box-shadow 0.2s ease-in-out;
    -moz-transition: background-color 0.2s ease-in-out,
        color 0.2s ease-in-out,
        -moz-box-shadow 0.2s ease-in-out;
    -o-transition: background-color 0.2s ease-in-out,
        color 0.2s ease-in-out,
        box-shadow 0.2s ease-in-out;
    background-image: -webkit-gradient(linear, left top, left bottom,
        color-stop(0.0, rgba(255, 255, 255, 0.8)),
        color-stop(0.01, rgba(255, 255, 255, 0.6)),
        color-stop(0.4, rgba(255, 255, 255, 0.3)),
        color-stop(0.4, rgba(255, 255, 255, 0.2)),
        color-stop(1.0, rgba(255, 255, 255, 0.0)));
    background-image: -moz-linear-gradient(top,
        rgba(255, 255, 255, 0.6) 0%,
        rgba(255, 255, 255, 0.3) 40%,
        rgba(255, 255, 255, 0.2) 40%,
        rgba(255, 255, 255, 0.0) 100%);
    background-color: #444;
    color: #fff;
    text-shadow: rgba(0, 0, 0, 0.5) 0px -1px 0px;
}
input[type=button]:hover, input[type=button]:focus, button:hover, button:focus {
    -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.9);
    -moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.9),
        inset 0px 1px 0px rgba(255, 255, 255, 0.5);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.9),
        inset 0px 1px 0px rgba(255, 255, 255, 0.5);
    background-color: #666;
    color: #fff;
}
input[type=button]:active, button:active {
    background-color: #222;
    color: #ccc;
    -webkit-transition-duration: 0.0s;
    -moz-transition-duration: 0.0s;
    -o-transition-duration: 0.0s;
}
下一步
受保护的void btnNext_单击(对象发送方,事件参数e)
{
//处理单击事件。。。
}

您不能在ASP按钮中使用CSSClass来定义CSS?请参见编辑,除非将其样式设置为按钮元素,否则并非所有效果都有效。我使用的CSS不适用于输入元素,仅适用于按钮元素。请看编辑,许多CSS效果不适用于看起来像很多讨厌的CSS的标记,它实际上做了什么?看这里按钮似乎有一些自己的问题。为什么要逆流而上?输入是一种方式。你是对的,用更少的CSS,我可以按照我想要的90%来设计它。
input[type=button], button {
    font-family: arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
    margin: 0px;
    padding: 5px 20px 5px 20px;
    outline-width: 0;
    border: 1px solid #000;
    border-radius: 7px;
    -moz-border-radius: 7px;
    -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5);
    -moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5),
        inset 0px 1px 0px rgba(255, 255, 255, 0.5);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5),
        inset 0px 1px 0px rgba(255, 255, 255, 0.5);
    -webkit-transition: background-color 0.2s ease-in-out,
        color 0.2s ease-in-out,
        -webkit-box-shadow 0.2s ease-in-out;
    -moz-transition: background-color 0.2s ease-in-out,
        color 0.2s ease-in-out,
        -moz-box-shadow 0.2s ease-in-out;
    -o-transition: background-color 0.2s ease-in-out,
        color 0.2s ease-in-out,
        box-shadow 0.2s ease-in-out;
    background-image: -webkit-gradient(linear, left top, left bottom,
        color-stop(0.0, rgba(255, 255, 255, 0.8)),
        color-stop(0.01, rgba(255, 255, 255, 0.6)),
        color-stop(0.4, rgba(255, 255, 255, 0.3)),
        color-stop(0.4, rgba(255, 255, 255, 0.2)),
        color-stop(1.0, rgba(255, 255, 255, 0.0)));
    background-image: -moz-linear-gradient(top,
        rgba(255, 255, 255, 0.6) 0%,
        rgba(255, 255, 255, 0.3) 40%,
        rgba(255, 255, 255, 0.2) 40%,
        rgba(255, 255, 255, 0.0) 100%);
    background-color: #444;
    color: #fff;
    text-shadow: rgba(0, 0, 0, 0.5) 0px -1px 0px;
}
input[type=button]:hover, input[type=button]:focus, button:hover, button:focus {
    -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.9);
    -moz-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.9),
        inset 0px 1px 0px rgba(255, 255, 255, 0.5);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.9),
        inset 0px 1px 0px rgba(255, 255, 255, 0.5);
    background-color: #666;
    color: #fff;
}
input[type=button]:active, button:active {
    background-color: #222;
    color: #ccc;
    -webkit-transition-duration: 0.0s;
    -moz-transition-duration: 0.0s;
    -o-transition-duration: 0.0s;
}
<button runat="server" id="btnNext"
    OnServerClick="btnNext_Click">Next &gt;</button>

protected void btnNext_Click(object sender, EventArgs e)
{
    // Handle the click event...
}