在gridview的多行文本中显示标签值

时间:2013-07-03 10:47:59

标签: c# asp.net gridview hyperlink label

我在一列中有一个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>

1 个答案:

答案 0 :(得分: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>

设置label的width属性,除非你为所有标签指定相同的字体名称,否则会使文本多线,字体大小保持不变