web analytics

How to translate an ASP.NET Label control into HTML heading element H1?

Options

codeling 1524 - 6369
@2021-05-02 13:02:16

As you know already, the ASP.NET label controls are translated into HTML inline elements <span> when you load an ASP.NET webform page in the browser:

<asp:Label ID="TopicTitle" runat="server" />

To generate them as HTML heading elements as <H1> or <H2> and so on, you should use another ASP.NET control named Literal and embedded them in the heading tag such as <H1> or <H2>:

<h1><asp:Literal ID="TopicTitle" runat="server" /></h1>

 

Comments

You must Sign In to comment on this topic.


© 2021 Digcode.com