如何打破描述行中的文本行 [英] how to break the line of text from the descriptio line

查看:64
本文介绍了如何打破描述行中的文本行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< asp:Label ID =   lbl_pname runat =   server Text = ' < span class =code-string><%#Eval(pname)%>' CssClass =   p_name /> 
< asp:Label ID = lbl_pprice Text = price:Rs。 runat = 服务器 CssClass = plbl /> < asp:Label ID = Label2 runat = server Text = ' < %#Eval(pprice)%>' CssClass = p_price / >< br />
< asp:标签ID = lbl_brand Text = 品牌: runat = server CssClass = plbl />< asp:Label ID = lbl_pbrand runat = server Text = ' <%#Eval( pbrand)%>' />< br />
< asp:标签ID = lbl_date Text = 更新日期: runat = server CssClass = plbl />< asp:标签ID = lbl_pdate runat = server Text = ' <%#Eval( pdate)%>' />< br />
< asp:标签ID = lbl_description Text = 描述: runat = server CssClass = plbl />< asp:Label ID = lbl_pdescription runat = server Text = ' <%#Eval( pdescription)%>' />< br />





以上代码行我们有pname,pprice,brand,pdate和description在插入描述内的行时显示一行段落,我想把段落分成多行,任何人都可以帮我解决这个问题吗?

解决方案

从我对你的问题的理解,我认为你想在每一行显示 pname,pprice,brand,pdate和description 。如果这是您所需要的,那么您可以将这些内容放入HTML表格中


尝试使用多行文本框来显示说明。



< asp:TextBox runat =" server" ID = QUOT; txtdesc"的TextMode = QUOT;多行"行= QUOT; 10"涡卷= QUOT;真" />


您可以将标签包装成 DIV 并相应地指定宽度。



 <   asp:label  < span class =code-attribute>   id   =  lbl_description    text   =  描述:    runat   =  server    cssclass   =  plbl  /  >  
< div style = width:20%; >
< asp:label id = lbl_pdescription runat = server text = <% #Eval( pdescription)%> / >
< / div >


<asp:Label ID="lbl_pname" runat="server" Text='<%#Eval("pname")%>' CssClass="p_name" />
<asp:Label ID="lbl_pprice" Text="price: Rs." runat="server" CssClass="plbl" /> <asp:Label ID="Label2" runat="server" Text='<%#Eval("pprice")%>' CssClass="p_price" /><br />
                <asp:Label ID="lbl_brand" Text="Brand: " runat="server"  CssClass="plbl"/><asp:Label ID="lbl_pbrand" runat="server" Text='<%#Eval("pbrand")%>' /><br />
                <asp:Label ID="lbl_date" Text="Updated on: " runat="server"  CssClass="plbl"/><asp:Label ID="lbl_pdate" runat="server" Text='<%#Eval("pdate")%>' /><br />
                <asp:Label ID="lbl_description" Text="Description: " runat="server"  CssClass="plbl"/><asp:Label ID="lbl_pdescription" runat="server" Text='<%#Eval("pdescription")%>' /><br /> 



the above line of code we have pname,pprice,brand,pdate and description while inserting the line inside the description it shows one line of paragraph and i want to break the paragraph into multiple line can anyone help me to solve this problem??

解决方案

From what i understood from your question, i think you want to display pname,pprice,brand,pdate and description in each line. if this is what you required then you can put these things in to a HTML table


Try using a mutiline text box to display description .

<asp:TextBox runat="server" ID="txtdesc" TextMode="MultiLine" Rows="10" Wrap="true" />


You can wrap the label into a DIV and assign a width accordingly.

<asp:label id="lbl_description" text="Description: " runat="server" cssclass="plbl"/>
<div style="width:20%;">
<asp:label id="lbl_pdescription" runat="server" text="<%#Eval("pdescription")%>"/>
</div>


这篇关于如何打破描述行中的文本行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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