如何截断字符串 [英] How to truncatethe string

查看:132
本文介绍了如何截断字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在asp.net中开发一个网站,当我在文本框中连续写无空格并且单击按钮时,我正在使用文本框和标签,并单击按钮显示i标签,然后显示连续单行并超出标签宽度.在文本超出标签宽度之前在新行中显示此文本.但是实际上我也希望显示html标签.


I am developing a website in asp.net in which I am using a textbox and label when i write in textbox continously without space and on button click it is showed i label then it shows continous singleline & goes out of the label width.I want to show this text in new line before the text goes out of label width.But actually i want dispaly html tag also

推荐答案

使用Wrap 属性 [
Use the Wrap property[^].

You can set the MultiLine property along with it to allow text to break into the next line.

E.g. <asp:TextBox Wrap="True" TextMode="MultiLine" runat="server"/>


参阅此内容:
geekswithblogs.net/StealThisCode/archive/2006/03/21/WrapLabels.aspx
Refer to this:
geekswithblogs.net/StealThisCode/archive/2006/03/21/WrapLabels.aspx


这篇关于如何截断字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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