First letter underlined for asp:button

G

Guest

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.
 
G

Guest

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top