How to add underline to specific asp.net button text words

I lowered the button in the form from the tool window in asp.net

I want the button text to be like Add, where only A from Add should be underlined.

I want only an asp button for the user.

we can do with the html button, but what about in asp.net?

thanks

+4
source share
2 answers

The asp.net control appears as an input element in html and you cannot style it the way you want it. The simplest solution is to simply use the html button, but add the runat = "server" attribute.

<button runat="server"><u>A</u>dd</button> 

Alternatively, you can create a new version of the asp.net button that appears as a button tag. See This Answer. How to use button tag with ASP.NET?

0
source

As already mentioned, the <asp:Button /> control does the markup a <input type='submit' />

The <input /> is what is called a void element and therefore cannot contain content. It should always be displayed without a closing tag.

To achieve what you want, you can follow the advice of Tim B James .

0
source

Source: https://habr.com/ru/post/1479251/


All Articles