I have a image button. I wanted to add a text \"Search\" on it. I am not able to add it because the \"imagebutton\" property in VS 2008 does not have text control in it. Can
This tip from dotnetslave.com worked for me:
<asp:LinkButton
CssClass="lnkSubmit"
ID="lnkButton"
runat="server">SUBMIT</asp:LinkButton>
a.lnkSubmit:active
{
margin:0px 0px 0px 0px;
background:url(../../images/li_bg1.jpg) left center no-repeat;
padding: 0em 1.2em;
font: 8pt "tahoma";
color: #336699;
text-decoration: none;
font-weight: normal;
letter-spacing: 0px;
}
<button runat="server"
style="background-image:url('/Content/Img/stackoverflow-logo-250.png')" >
your text here<br/>and some more<br/><br/> and some more ....
</button>
I prefer the below solution:
<div style="padding: 5px; float: left;overflow: auto;height: auto;">
<asp:ImageButton ID="ImageButton2" ImageUrl="./icons/search24.png" ToolTip="Search" runat="server" />
<p><asp:Label ID="Label7" runat="server" Text="Search"></asp:Label></p>
</div>
You can change the style
to make it center aligned, etc.