将 <asp:Button ID="Button1" runat="server" Text="Button" Style="font-weight: bold;
background-image: url(/WebResources/Images/V2/DarkOrange_bg_h24.jpg);" ForeColor="Blue" />里面加一个background-color: Transparent;,也就是: <asp:Button ID="Button1" runat="server" Text="Button" Style="font-weight: bold; background-color: Transparent;
background-image: url(/WebResources/Images/V2/DarkOrange_bg_h24.jpg);" ForeColor="Blue" />就可以了,要想背景图片起效果,必须将按钮的背景颜色为透明才起作用。默认的都不行的。
有的asp:Button 没有Style ,可以这样实现:
用css
.ImgBgButton
{
background-image: url(../Images/button.gif);
}
<asp:button id="B_Save" runat="server" Text="保 存" CssClass="ImgBgButton"></asp:button>