如何在中继器中基于逗号(,)在多行中显示标签文本 [英] How to display label text in Multiple lines based on comma(,) in repeater
本文介绍了如何在中继器中基于逗号(,)在多行中显示标签文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要根据逗号在转发器中多行显示地址.
从后端我正在检索地址
<asp:Label ID="lbl_address" runat="server" Font-Bold="true" Text=''<%#Eval("contact_address")%>'' ></asp:Label>
我已经像这样存储了后端..
达喀尔,电子城,班加罗尔.
我需要像这样散布..
dharshan,
电子城,
班加罗尔.
该怎么做?
解决方案
您可以添加< br/>.那是html中的换行符.
如果pre标签是lang ="Text"
,则将pre标签修改为指定的"break"未出现在解决方案中 [/Edit]
类似的东西应该可以帮助:
< asp:label id =" ="span> runat =" 服务器" 字体粗体 true" 文本 =' <% #Eval (" ).ToString().Replace( " ," )%>' < /asp:label >
>
I need to display address in multiple line in repeater based on comma.
From backend i''m retrieving address
<asp:Label ID="lbl_address" runat="server" Font-Bold="true" Text=''<%#Eval("contact_address")%>'' ></asp:Label>
backend i have stored like this..
dharshan,Electronic city,bangalore.
i need to dispaly like this..
dharshan,
Electronic city,
bangalore.
How to do that?
thanks in advance..
解决方案
You can just add<br />after the commas. That''s a line break in html.
[Edit Nazia]
Modified the pre tags as the "break" specified didn''t appeared in the solution if the pre tag is lang="Text"
[/Edit]
Something like this should help:
<asp:label id="lbl_address" runat="server" font-bold="true" text='<%#Eval("contact_address").ToString().Replace(",",",<br />")%>'></asp:label>
这篇关于如何在中继器中基于逗号(,)在多行中显示标签文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文