如何preserve格式在多行文本框 [英] How to Preserve Formatting in a Multi-Line Text Box

查看:171
本文介绍了如何preserve格式在多行文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,我创建一个文本框,多行运行时根据一些选择,例如,它们指定线条宽度的号码,然后创建文本框,并把它放在一个盘下页。我的问题是,在文本框中,他们希望这样写:

I have a website where I create a textbox multi-line at runtime depending on some selections for example, they specify the number of lines and the width, then I create the textbox and put it in a panel on the next page. My issue is that in the textbox they would like to write something like this:

   Company Name
   123 Test Avenue
   New York, NY 10001

我想preserve的格式,我的意思,这是下一行保持作为一个块,现在如果他们在文本框中输入时一样,它会显示这样的:

I would like to preserve the formatting, what i mean by this is keeping the next lines as a block, right now if they entered it like that in the textbox it would show like this:

Company Name 123 Test Avenue New York, NY 10001

是否与&LT做到这一点的方式在所有; ASP:文本框/> 多行

推荐答案

您需要使用像 CKEditor的控制。 (<一href=\"http://www.google.com.au/search?hl=en&tbo=d&q=free%20asp.net%20rich%20text%20editor&oq=free%20asp.net%20rich%20text%20editor&gs_l=serp.3..0j0i30j0i8j0i8i30l6j0i22.5934.7477.0.7754.9.7.2.0.0.0.265.1210.1j2j4.7.0.les;..0.0...1c.1.FaZb_kFN7IQ\"相对=nofollow>为asp.net 富文本编辑器)

You need to use a control like ckeditor . (Rich text editors for asp.net)

文本区域(ASP:文本与模式=多行),不保存格式,而你的情况是&LT; BR /&GT;

TextArea (asp:textbox with mode="multiline") does not save the formatting, which in your case is <br/>

要坚持富文本,你需要提前考虑可能出现的问题的数据库。

To persist the rich text into the database you need to think of possible problem in advance.

如何保存在SQL服务器 HTML数据

如何HTML保存到数据库字段

http://forums.asp.net/t/1669475.aspx/1

这篇关于如何preserve格式在多行文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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