- HTML code
<button class="btn1_mouseout" onmouseover="this.className='btn1_mouseover'" onmouseout="this.className='btn1_mouseout'" id="btnOK" onclick="btnOK_click">登录</button>
然后在该页的后台cs文件中:
- C# code
protected void btnOK_click(object sender, EventArgs e) { lblWelcome.Text = "已登录"; }
貌似点击根本就不起作用啊,应用html的button主要是应用动态漂亮的样式
------解决方案--------------------------------------------------------
加上 runat="server" 然后用onserverclick事件就可以了
<button class="btn1_mouseout" onmouseover="this.className='btn1_mouseover'" runat="server" onserverclick="btnOK_click"
onmouseout="this.className='btn1_mouseout'" id="btnOK" >登录</button>