Click here to Skip to main content
15,910,234 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends ,

I am using VS 2005 , framework2 and c#.net, asp.net.
I have implemented keyboard access key for save button .
It is Alt +s .

I want to underline for short cut key in the text of button like Save.
How to implement this ?

Thanks in advance,
George
Posted

1 solution

XML
<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");
}


OR try with AccessKey property

<asp:button id="Button1" runat="server" Text="Print" AccessKey="P" />
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 9-Feb-11 1:38am    
That is correct, my 5.
Also good to underline the character matching access key (with ) in text of the element.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900