Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to put underline for access key for <asp:button>?

Tags:

c#

.net

asp.net

How to put underline for first letter for access key for ?

like image 695
Nikita Avatar asked Oct 21 '08 06:10

Nikita


1 Answers

asp:buttons are output as html "input" tags with a type of "submit". The text displayed on them is output in the "value" attribute of the tag, and so cannot contain any styling or html. If you could get an asp:button to output as an html button then you could try something like:

<button id="mybutton" runat="server" onserverclick="myfunction">
<span style="text-decoration:underline;">P</span>rint</button>

and use a normal button event in your c# code:

protected void myfunction(object sender, EventArgs e)
{
    Response.Write("clicked");
}
like image 161
Rob Bell Avatar answered Oct 19 '22 23:10

Rob Bell