Click here to Skip to main content
15,868,034 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear Friends

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.
HTML
<asp:Button ID="btnFilter" runat="server"  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.


Thanks & Regards

pardeep
Posted
Updated 28-May-13 23:54pm
v3
Comments
Orcun Iyigun 29-May-13 5:07am    
Is it something that you want user to access it by pressing Alt+F? You mentioned it but try btnFilter.Text = "&Filter"; as well.

Hi,

Try This :)[^]
 
Share this answer
 
Hello,

You will not be able to do so with asp:Button however with HtmlButton you can do this as shown below.
HTML
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Data from Service ASPX</title>
<style type="text/css">
body { font-family: Verdana, Thaoma; }
button em { text-decoration: underline; font-style:normal;}
</style>
</head>
<body>
	<form id="form1" runat="server">
		<asp:Button ID="btnFilter" runat="server" Text="Filter" AccessKey="F" />
		<button ID="btnSubmit" runat="server" AccessKey="S"><em>S</em>ubmit</button>
	</form>
</body>
</html>

Different browser's are going to differ in how they offer support for AccessKey. Please go through this wikipedia article to know more about how different browser's implement this behaviour.

Regards,
 
Share this answer
 
v2
Use this link..
and i think this link really helpful to u..

Asp.net - underline for short cut key in the text of button[^]

Thanks & regard
Shambhoo.
 
Share this answer
 

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



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