You will need to use both an image button and a Link button. The image button on its own will not suffice.
Hope this works.How can I combine an image button with a text property in ASP.NET?
You don't even need code behind...Just use this code....It basically hides the default button appearance so you can put the text on there. I even added some mouse over events for you. Should get you started.
Goodluck
For some reason yahoo truncates the text..the line that ends with ';.clas...'; is supposed to say ';className';
%26lt;script type=';text/javascript';%26gt;
//ADD BORDERS ON THE MOUSE OVER EVENT AND CHANGE THE CURSOR
function OnMouseOver()
{
document.getElementById('spanMain').clas鈥?= 'spanHover';
}
function OnMouseOut()
{
document.getElementById('spanMain').clas鈥?= 'spanNormal';
}
%26lt;/script%26gt;
%26lt;style type=';text/css';%26gt;
.spanNormal,
.spanHover,
.spanGeneric
{
background-image:url('SomeImage.jpg');
background-repeat:no-repeat;
height:26px;
}
.spanNormal
{
border:solid 3px transparent;
}
.spanHover
{
border: solid 3px DarkGray;
cursor:pointer;
}
%26lt;/style%26gt;
%26lt;span id=';spanMain'; onmouseover=';OnMouseOver()'; onmouseout=';OnMouseOut()'; class=';spanNormal';%26gt;
%26lt;asp:Button BackColor=';Transparent'; BorderColor=';Transparent'; BorderStyle=';None'; ID=';btnText'; runat=';server'; Width=';75px'; Height=';20px'; Font-Bold=';true'; Font-Size=';15px'; Text=';YourText'; /%26gt;
%26lt;/span%26gt;
No comments:
Post a Comment