使标签多行 [英] Make label multiline
本文介绍了使标签多行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道最简单的办法是使标签具有多行文本框,但因为我要呈现的文本值内锚标记,这并不解决问题。例如:
< ASP:标签ID =myLabel=服务器文本=这是我的标签等等...去
此处< A HREF =Destn.aspx'>此处&下; / A>更新/>
这不能使用文本框,因为文本框将不显示锚标记为一个链接,将显示为纯文本来完成
解决方案
< ASP:标签
ID =myLabel
=服务器
风格=自动换行:打破字;
WIDTH =140px
文本=这是我的标签等等...去此处< A HREF ='Destn.aspx'>此处< / A>至更新/>
添加width属性,并提供任何你想要的任何适当的值,并添加一个CSS样式,这将包裹字
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. 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 can't be done by using a textbox since a textbox will not display the anchor tag as a link instead it will display as plain text
解决方案
<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
这篇关于使标签多行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文