Is their only asp network server that can display the <label> tag?

I want to display a tag <label>. But you want to set some of its properties while they are displayed for both, and for text value.

Actually, my real problem is that I want to link the label with a switch, and this is the code that I have:

<asp:RadioButton ID="Option4" GroupName="A" runat="server" />

<label for='<%=Option4.ClientID %>' id="lblOption4" runat="server">4</label>

But the problem with this code is that it does not work and does not display a value for , since it is equal to ie <% = Option4.ClientID%>.: - (

Is there any asp net server that will display the tag?

I don’t want to set the Text property for the switch due to some CSS limitations, so PLZ does not give answers, for example, why you do not set the Text property for the switch.

+3
source share
2 answers

if it is .NET 2.0 or later, then use the ASP.NET LABEL control.

<asp:RadioButton ID="Option4" GroupName="A" runat="server" />
<asp:Label AssociatedControlId="Option4" Text="4" runat="server" />
+11
source

If you end up with accessibility issues, you can try the following guide: Creating an affordable LABEL control in ASP.NET

0
source

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


All Articles