c# - c# asp.net 3.5 中图像按钮上的文本

标签 c# asp.net

我有一个图像按钮。我想在上面添加一个文本“搜索”。我无法添加它,因为 VS 2008 中的“imagebutton”属性中没有文本控件。谁能告诉我如何向图像按钮添加文本?

  <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# - c# asp.net 3.5 中图像按钮上的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/262141/

相关文章:

c# - 方法是否选择退出类级别的 AuthorizeAttribute?

c# - 如何测试.net web应用程序中哪个方法执行需要多长时间

asp.net - 我可以在 SQL session 状态配置中重用现有连接字符串吗?

c# - "The path .. would result in a file outside the App Bundle and cannot be used"错误,单触摸/Xamarin

c# - 引发事件似乎已经改变

.net - idleTimeout 和 ShutdownTimeout 之间的区别

javascript - 在 ASP.NET MVC 中使用 bootbox.js 添加选项以在自定义对话框中选择表单控件

c# - 无法在 GridView 中持久化数据

c# - 当 View mvc 中的表单中有 foreach 循环时,action 方法的参数应该是什么

c# - 在 app.config 中使用提供程序 'DataProtectionConfigurationProvider' 解密失败