在C#asp.net 3.5图像按钮文本 [英] Text on an Image button in c# asp.net 3.5
本文介绍了在C#asp.net 3.5图像按钮文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个图像按钮。我想添加一个文本上的搜索。我不能添加,因为在VS 2008中ImageButton的属性不会有它的文本控件。谁能告诉我如何添加文本到图像按钮?
< ASP:ImageButton的ID =搜索按钮=服务器还有AlternateText =搜索
的CssClass =bluebutton
的ImageUrl =../图形/ bluebutton.gifWIDTH =110px
的onclick =Searchbutton_Click/>
解决方案
<按钮=服务器
风格=背景图片:URL('/内容/图/计算器-标志-250.png')>
在这里您文字< BR />和一些详情< BR />< BR />多一些....
< /按钮>
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 anyone tell me how to add text to a image button??
<asp:ImageButton ID="Searchbutton" runat="server" AlternateText="Search"
CssClass="bluebutton"
ImageUrl="../Graphics/bluebutton.gif" Width="110px"
onclick="Searchbutton_Click"/>
解决方案
<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>
这篇关于在C#asp.net 3.5图像按钮文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文