【问题标题】:displaying label values in multiline text from gridview从gridview显示多行文本中的标签值
【发布时间】:2013-07-01 00:34:45
【问题描述】:

我有一个gridview,其中有一列中有hyperlink,当用户单击该链接时,他将被定向到另一个页面,该页面将使用单独的标签显示特定行的详细信息。在那些labels 中,其中一个标签对我来说必须是多行的,因为文本会太长......

请帮助我如何获得它。

标签的aspx页面

<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>

【问题讨论】:

  • 看看这个question
  • 感谢回复 tht 帖子,但我希望我的标签与其他标签的大小相同...所以我无法获取宽度属性并对其进行格式化..
  • 这是一个非常相似的问题中的css solution
  • 您真的需要为您的标签指定Height 吗?尝试从标签声明中删除Height="16px"
  • thnks 伙计...效果很好...请把它作为您的答案...会接受...

标签: c# asp.net gridview hyperlink label


【解决方案1】:

试试这个....

<asp:Label ID="lblName" runat="server" Text="User1" Font-Bold="True" Font-Names="Verdana"></asp:Label>
<br />
<asp:Label ID="lblDescription" runat="server" Font-Bold="True" Font-Names="Verdana"
       Width="300px" Text="I got one gridview which has hyperlink in one column, when 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 because the text will be too long">
</asp:Label>

设置标签的宽度属性,将使文本多行并且字体大小将保持不变,除非您为所有标签指定相同的字体名称

【讨论】:

  • renuka ji thnks for d 回复... bt wat 我需要的是我的标签不应该用 d 大小的 frm othr 标签和我为特定标签 frm 数据库检索 d 文本... neways i gt d 解决方案... :)
  • apke 回答 k liye bahut bahut dhanyavadh :)
猜你喜欢
  • 1970-01-01
  • 2013-02-08
  • 1970-01-01
  • 1970-01-01
  • 2013-05-12
  • 1970-01-01
  • 2017-09-18
  • 2018-02-28
  • 1970-01-01
相关资源
最近更新 更多