473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

First letter underlined for asp:button

Is it possible to have the text of the first-letter in an <asp:button>
underlined? I was able to do the following to get the first letter
underlined:

<STYLE type="text/css">
BUTTON:first-letter { TEXT-DECORATION: underline }
</STYLE>
<button id="btnTest" accesskey="T" runat="server" type="button" value="Test"
Test</button>

But this won't work for an asp:button. Inorder to get the above to work i
have to put it in the <button> tag. Help would be greatly appreciated.

--
Thanks
Prisy
Nov 17 '05 #1
2 4993
You can add attributes to the control using the following:

MyTextBox.Attributes.Add("onKeyPress", "alert(\"Hello World\");");

You can also use the CssClass attribute of the button if you just want to
apply a style.

"Prisy" wrote:
Is it possible to have the text of the first-letter in an <asp:button>
underlined? I was able to do the following to get the first letter
underlined:

<STYLE type="text/css">
BUTTON:first-letter { TEXT-DECORATION: underline }
</STYLE>
<button id="btnTest" accesskey="T" runat="server" type="button" value="Test"
Test</button>

But this won't work for an asp:button. Inorder to get the above to work i
have to put it in the <button> tag. Help would be greatly appreciated.

--
Thanks
Prisy

Nov 17 '05 #2
Doesn't an <asp:button> tag actually render on the client side as an
<input type="button"> tag which is not treated by CSS the same as the tag
<BUTTON>? So the problem is you need to modify your Style to apply to
the INPUT tag.
--
"If it's possible...someone can do it.
If it's impossible...someone will know someone that can do it."
- Opossum, Programmer/Analyst/Cave-dweller
"Prisy" wrote:
Is it possible to have the text of the first-letter in an <asp:button>
underlined? I was able to do the following to get the first letter
underlined:

<STYLE type="text/css">
BUTTON:first-letter { TEXT-DECORATION: underline }
</STYLE>
<button id="btnTest" accesskey="T" runat="server" type="button" value="Test"
Test</button>

But this won't work for an asp:button. Inorder to get the above to work i
have to put it in the <button> tag. Help would be greatly appreciated.

--
Thanks
Prisy

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: RSB | last post by:
Hi Every one, Having tuff time to make this work .. i want to have a button and on my form say Delete button. So once i click on it i want to confirm "Are you sure?" on the Client Side and if...
11
by: Frag | last post by:
Hi guys, I searched around without any clear answer. Tons of stuff, but nothing concrete. I am trying to call this Javascript function: function ButtonClicked() { alert("The button has...
0
by: Maziar Aflatoun | last post by:
Hi everyone, I have the following shopping cart (basket view). However, Delete button in my datagrid doesn't fire any events. Does anyone know why? (It's a user web control) <%@ Control...
2
by: Chris Fink | last post by:
Hello, I have a datalist that contains an asp button. I have the need to pass a value that is bound to my datalist along the button when the on_click event is fired. My datalist creates a button...
3
by: Jeff | last post by:
I need to intercept the Click event of a asp:Button on the client side so that i can disable it after they've clicked it... HOW can i do this?? I was thinking of making the button an HTML button...
4
by: z. f. | last post by:
Hi, I'm having an aspx page with a server form. i have a grid with a delete button and below the grid, another area with inputs for inserting new values and an "add" button for submiting the...
7
by: Venus | last post by:
Hello, I am trying to generate a dynamic form at runtime and would like to do it using "<asp: ..." form elements as follows Build up the string that is placed somewhere in the HTML code the...
4
by: hb | last post by:
Hi, When I add an asp:button (ex: id=btnLog) on home.aspx, I need to create btnLog_Click() event in home.aspx.cs, and also link this event and the button in OnInit() method by adding:...
1
by: RUIZCJ | last post by:
Hi, I'm at my wits end!!! I have the following code. The submit button works on my home computer but when I copy the dll and the ASPX file to my host provider, the button does NOT fire. TIA...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.