Make label multiline

后端 未结 3 2013
情书的邮戳
情书的邮戳 2021-01-05 02:33

I know the easy solution would be to make the label a textbox with multiline but this does not solve the problem since I want to render anchor tags inside the text value. Fo

相关标签:
3条回答
  • 2021-01-05 02:46
    <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 width property and provide any appropriate value whatever you want and add one css style which will wrap the word

    0 讨论(0)
  • 2021-01-05 03:01

    Select the dropdown next to the label. Then Press Ctrl + Enter key for Line - break

    Edit

    It work only when page open in Design Mode

    0 讨论(0)
  • 2021-01-05 03:04

    Use <br/> in your TEXT to create new row in label text.

    <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 HTML Line Break Element) produces a line break in text (carriage-return).

    0 讨论(0)
提交回复
热议问题