2013-07-03 25 views
1

我得到一個gridview,其中一列中有hyperlink,當用戶點擊鏈接時,他將被引導到另一頁面,其中使用單獨標籤顯示特定行的詳細信息。在那些labels其中一個標籤必須爲我多線,因爲文字會太長...在GridView的多行文本中顯示標籤值

請幫助我如何得到這一點。標籤的

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

看看這個[問題](http://stackoverflow.com/questions/3717190/multiline-label-in-asp-net)。 –

+1

thnks for replyng與帖子,但我希望我的標籤B在相同大小的othr標籤...所以我不能採取寬度屬性和格式。 – Suraj

+0

這是[css解決方案](http:// stackoverflow。 com/a/16663014/451518)中的一個非常類似的問題。 –

回答

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> 

設置標籤的寬度屬性,將使得文本multilined和字體大小將保持不變,除非你指定所有的標籤相同的字體名稱

+1

renuka ji thnks for d reply ... bt wat i需要的是我的標籤shuldn​​t得到改變的大小frm othr標籤和im retriving d文本的特定標籤frm數據庫...新的我GT D解決方案... :) – Suraj

+1

apke答案k liye bahut bahut dhanyavadh :) – Suraj