Make multi-line tag

I know that a simple solution would be to make the label a multi-line text box, but this does not solve the problem, since I want to display anchor tags inside the text value. For example:

<asp:Label ID='myLabel' runat="server" Text=" This is my label etc... go here <a href='Destn.aspx'>Here</a> to update" /> 

This cannot be done with a text field, since the text field will not display the anchor tag as a link, instead it will appear as plain text

+8
source share
3 answers
 <asp:Label ID='myLabel' runat="server" style="word-wrap:break-word;" Width="140px" Text=" This is my label etc... go here <a href='Destn.aspx'>Here</a> to update" /> 

Add a width property and provide any suitable value that you would like, and add one css style that wraps the word

+8
source share

Use <br/> in your TEXT to create a new line in the text of labels.

 <asp:Label ID='myLabel' runat="server" Text=" This is my label etc... go <br /> here <a href='Destn.aspx'>Here</a> to update" /> 

See: <br> - MDN

The HTML <br> element (or the HTML line break element) creates a line break in the text (carriage return).

+6
source share

Select the drop-down list next to the label. Then press Ctrl + Enter for Line-break

Edit

Only works when opening a page in design mode

0
source share

All Articles