在gridview的多行文本中显示标签值 [英] displaying label values in multiline text from gridview

查看:73
本文介绍了在gridview的多行文本中显示标签值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到1个gridview,其中一列中有超链接,当用户点击链接时,他将被定向到另一个页面,其中将使用单个标签显示特定行的详细信息。在那些标签中,其中一个标签必须是多行的,因为我的文字太长了...



请帮我怎么做。



aspx标签页







 <   asp:标签    ID   =  LblDescription    runat   =  server  

字体粗体 = True 字体名称 = Verdana

字体大小 = X-Small ForeColor = #0061C1 高度 < span class =code-keyword> = 16px
< span class =code-attribute>
宽度 = 97px BorderColor = #0061C1

BorderWidth = 1px BackColor = 白色 > < / asp:标签 >

解决方案

我得到了解决方案...通过添加style =word-wrap:break-word;标签和删除标签的高度属性可以实现



 <   asp:标签    ID   =  LblDescription    runat   =  server  

Font-Bold = True 字体名称 = Verdana

字体大小 = X-Small ForeColor = #0061C1 高度 = 16px

< span class =code-attribute> 宽度 = 97px 边框颜色 = #0061C1

BorderWidth = 1px style = 自动换行:break-单词; BackColor = 白色 > < / asp:Label >


i got 1 gridview which has hyperlink in one column, wen the user clicks the link he will be directed to another page where the details of particular row will be displayed using individual labels. In those labels one of the label must be multilined for me coz the text will be too long...

Please help me how to get that .

aspx page of label



<asp:Label ID="LblDescription" runat="server"

            Font-Bold="True" Font-Names="Verdana"

            Font-Size="X-Small" ForeColor="#0061C1" Height="16px"

            Width="97px" BorderColor="#0061C1"

            BorderWidth="1px" BackColor="White"></asp:Label>

解决方案

i got the solution... by adding style="word-wrap:break-word;" to label and removing the height property of label can achieve tht

<asp:Label ID="LblDescription" runat="server"

            Font-Bold="True" Font-Names="Verdana"

            Font-Size="X-Small" ForeColor="#0061C1" Height="16px"

            Width="97px" BorderColor="#0061C1"

            BorderWidth="1px" style="word-wrap:break-word;"  BackColor="White"></asp:Label>


这篇关于在gridview的多行文本中显示标签值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆