给你一个按钮的onMouseOver\onMouseOut事件写法(VB.NET):
btn_back.Attributes.Add("onMouseOver", "this.style.backgroundColor='lightgreen'")
btn_back.Attributes.Add("onMouseOut","this.style.backgroundColor='limegreen'")
btn_back.Attributes.Add("onMouseOver", "this.style.backgroundColor='lightgreen'")
btn_back.Attributes.Add("onMouseOut","this.style.backgroundColor='limegreen'")
{
// 在此处放置用户代码以初始化页面 if(!Page.IsPostBack)
{
btn_back.Attributes.Add("onMouseOver", "this.style.backgroundColor='lightgreen'");
btn_back.Attributes.Add("onMouseOut","this.style.backgroundColor='limegreen'");
}
}