datalist里linkbutton样式问题
datalist里放了个linkbutton现在我鼠标移上去我想linkbutton变黑色移出来变白色...
datalist里放了个linkbutton现在我鼠标移上去 我想linkbutton变黑色 移出来变白色
展开
2个回答
展开全部
DataIist_RowDataBound事件
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes["onmouseout"] = "javascript:this.style.backgroundColor='#E8F4FF';";
e.Row.Attributes["onmouseover"] = "javascript:this.style.backgroundColor='#d9a88f';cursor='hand';";
}
else
{
e.Row.Attributes["onmouseout"] = "javascript:this.style.backgroundColor='#ffffff';";
e.Row.Attributes["onmouseover"] = "javascript:this.style.backgroundColor='#93BEE2';cursor='hand';";
}
}
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes["onmouseout"] = "javascript:this.style.backgroundColor='#E8F4FF';";
e.Row.Attributes["onmouseover"] = "javascript:this.style.backgroundColor='#d9a88f';cursor='hand';";
}
else
{
e.Row.Attributes["onmouseout"] = "javascript:this.style.backgroundColor='#ffffff';";
e.Row.Attributes["onmouseover"] = "javascript:this.style.backgroundColor='#93BEE2';cursor='hand';";
}
}
展开全部
将linkbutton放到一个<table>里面
<tr onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''">
<asp:LinkButton ID="LinkButton1" CssClass="lb_css" runat="server">LinkButton</asp:LinkButton>
</tr>
<tr onmouseover="this.style.backgroundColor='#FFFFFF'" onmouseout="this.style.backgroundColor=''">
<asp:LinkButton ID="LinkButton1" CssClass="lb_css" runat="server">LinkButton</asp:LinkButton>
</tr>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询