ASP.NET Web Forms > Label and Literal

Label control text in ASP.NET Web Forms

How to write Text for the asp:Label control?


In case we need to write some text on the page at specified place, you can keep an asp:Label control and specify its text. Keeping text in the asp:Label control enable you to access it from server side as well. 

ASPX.page
<p><asp:Label ID="Label1" runat="server" Text="My first Label"></asp:Label></p> 

Simply specify the Text attribute of the Label control. 

 Views: 1772 | Post Order: 7



Write for us






Hosting Recommendations