How do I underline the accesskey in the button text?

I currently have this button and do not know how to get the F underlined in the button text. I tried adding the & before the letter I wanted underlined and that did not work must be a menu only thing.

<asp:Button ID="btnFilter" runat="server" OnClick="btnFilter_Click" Text="Filter" AccessKey="F" />

I thought about changing it to an html button but assumed there would have to be some way to do it as an asp button. Any help would be much appreciated.



Answer this question

How do I underline the accesskey in the button text?

  • firewalker

    How do you get the underline in an html button

  • Erik Moore

    In ASP.NET 1.1, the Button Web server control didn't support underline text. You could use the HTML Button control instead but you'll need to move any Button_Click event processing to the Postback area of Page_Load .

    This may have changed with 2.0.


  • Meareg

    That does not work. All it does is put the Submit text to the left of the button instead of changing the text of the button to Submit.

    Thanks for trying.


  • KPLNG

    Sorry about that. I can’t find any way to get Button text to be underlined by setting the properties. If this was easy, we’d be seeing it on the web regularly, but I haven’t even seen it on a Microsoft site, like for example, this forum's buttons.

     

    Looks like an “opportunity” to build a new Accelerated Button component.



  • Dario de Judicibus

  • How do I underline the accesskey in the button text?