日期:2014-05-19  浏览次数:20466 次

急!请问高手!如何解决ASP.NET1.1从SQL2000读取文章保持格式完整
在asp.net1.1页面中使用datagrid控件从sql2000数据库中读取已经存在的一篇文章,但是读取出来的文章格式全部乱了,请问该如何解决这种问题呢,保证文章在页面中的格式正常!谢谢

------解决方案--------------------
<asp:DataList ID= "NewsDataList " runat= "server " DataSourceID= "SqlDataNews " OnItemCommand= "NewsDataList_ItemCommand "
RepeatColumns= "1 " Width= "589px ">
<ItemTemplate>
<table style= "width: 670px; height: 106px ">
<tr>
<td align= "center " colspan= "3 ">
<%#DataBinder.Eval(Container.DataItem, "Title ")%>
</td>
</tr>
<tr>
<td style= "width: 69px ">
<asp:Label ID= "NewsID " runat= "server " Text= ' <%# Eval( "NewsID ") %> ' Visible= "False "> </asp:Label> </td>
<td align= "center " style= "width: 182px ">
发布时间 <%#DataBinder.Eval(Container.DataItem, "IssuanceTime ")%> </td>
<td>
</td>
</tr>
<tr>
<td align= "left " colspan= "3 " valign= "top ">
<%#DataBinder.Eval(Container.DataItem, "Detail ")%>
</td>
</tr>
<tr>
<td align= "right " colspan= "3 ">
<asp:LinkButton ID= "Detail " runat= "server " CommandName= "Detail "> 详情 </asp:LinkButton> </td>
</tr>
</table>
</ItemTemplate>
<SeparatorStyle Wrap= "True " />
</asp:DataList>
------解决方案--------------------
写一个格式化的函数,把那些个特殊字符都转换一下,读写的时候都转换一下,就好了
------解决方案--------------------
如果要保存格式,最好使用FCKedit等输入控件输入文章