【问题标题】:"\n" does not work inside an ASP:Button for Internet Explorer 10"\n" 在 Internet Explorer 10 的 ASP:Button 中不起作用
【发布时间】:2015-02-01 01:03:33
【问题描述】:

我在按钮上有一些文本,我想在按钮内换行我这样做:

btn.Text = "Find\n Transactions";

这适用于 Internet Explorer 9,但不适用于 Internet Explorer 10。

我也尝试过 environment.newline 变体,但这不起作用。

【问题讨论】:

  • 2 Line Button Value的可能重复
  • @walther 很抱歉我没有明确说明 ASP:BUTTON 吗?
  • 另一种方式,您可以尝试使用asp.net LinkButton 呈现为<a />,您可以在其中添加一些html。
  • @Bharadwaj 感谢您的建议。

标签: c# asp.net asp.net-mvc-4 internet-explorer-10


【解决方案1】:

就用这个吧:

Environment.NewLine();

像这样:

btn.text = "some" + Environment.NewLine() + "text";

【讨论】:

    【解决方案2】:

    你可以试试 vbCrLf,当然如果你在 web applciation 中,试试<br />

    【讨论】:

      【解决方案3】:

      尝试使用

      <asp:Button Text="Hello&#010;World" runat="server" ID="cmdHello" />
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-06-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-05-21
        • 1970-01-01
        • 2014-10-12
        • 2013-03-27
        相关资源
        最近更新 更多