当前位置:网站首页>换行问题双保险
换行问题双保险
2022-07-27 16:24:00 【微服务布道者】
在ASP.NET中,把数据从数据库里面提取并显示在页面上,一般用< asp:Lable />,或者直接用<% # %>来显示出来,中文字符一般不回出现不能换行的问题,英文,或者连续的标点,就会出现不能自动换行,把网页给撑破了,这里有2个解决方法:
(1)在<td />里面用<% # %>来显示数据:
<td style="word-break:break-all;word-wrap: break-word"><% # %></td>
(2)在向数据库提交数据之前,把换行符号替换成为<br>:
chr=chr.Replace("/n","<br>");
(3)<td style="word-break:break-all;word-wrap: break-word" width="600" align="left" bgcolor="#FFFFFF">
<p><span class="css">内容:<br>
--------<%=rs("content")%></span></p>
<div align="center"> </div>
<div align="right"><span class="css"> 发表时间:<%=rs("time")%> </span></div></td>
</tr>
边栏推荐
猜你喜欢

Product recommendation and classified product recommendation

USB rechargeable hand warmer chip dltap602sc Jericho

How to break the team with automated testing

C # interaction with MySQL database - MySQL configuration and addition, deletion, query and modification operations

Order submission

During the interface test, connect to the database and back up, restore and verify the data source

MySQL 04 advanced query (II)

Self control principle learning notes - system stability analysis (1) - BIBO stability and Routh criterion

MySQL 03 advanced query (I)

Kinect2 for Unity3D——AvatarDemo学习
随机推荐
Leetcode brushes questions the next day
Self control principle learning notes - system stability analysis (1) - BIBO stability and Routh criterion
Jmeter接口自动化-如何解决请求头Content-Type冲突问题
Blog Garden beautification tutorial
The great idea of NS2
MongoDB
专项测试之「 性能测试」总结
Introduction to assembly language (1)
Selenium automated test interview questions family bucket
I'm stupid. When completable future is used with openfegin, it even reports an error
C interface knowledge collection suggestions collection
Typeerror: conv2d(): argument 'padding' (position 5) must be multiple of ints, not STR [error]
Talking about JVM (frequent interview)
Redis annotation
Interviewer: what do you think is your biggest weakness?
Extension of ES6 value
LeetCode 刷题 第二天
Household mute mosquito repellent lamp chip-dltap703sd-jericho
C static method and non static method
MySQL 03 advanced query (I)