在线编辑器修改时内容被截掉!高手请帮忙!

来源:百度知道 编辑:UC知道 时间:2024/05/12 04:50:24
<div align="center"><br>
<form ACTION="<%=MM_editAction%>" METHOD="POST" name="form1">
<table width="620" border="0" cellpadding="0" cellspacing="1">
<tr>
<td height="50" bgcolor="#59ACFF"><div align="center" class="style1"> 编 辑 版 权 信 息 内 容 </div></td>
</tr>
<tr>
<td><input name="content" type="hidden" id="content"value="<%=(Recordset1.Fields.Item("content").Value)%>">
<IFRAME ID="eWebEditor1" SRC="../ewebeditor/ewebeditor.asp?id=content&style=s_blue" FRAMEBORDER="0" SCROLLING="no" WIDTH="620" HEIGHT="350"></IFRAME></td>

就是在这里:<input name="content" type="hidden" id="content" value="<%=(Recordset1.Fields.Item("content").Value)%>">

改成: value="<%=server.htmlencode(Recordset1.Fields.Item("content").Value)%>"

如果不使用Server.HTMLEncode()进行处理的话,将会有如下后果:

如Recordset1.Fields.Item("content").Value=“adf"afadf”(包含引号)
这时,在编辑的过程中,传递到编辑器的值只是“adf”,即引号前的部分。

建议将<input name="content">改成<textarea name="content" style="display:none"></textarea>

不过要注意:这里也要使用server.htmlencode,否则遇到</textarea>”时同样会被截掉。

同意
value="<%=server.htmlencode(Recordset1.Fields.Item("content").Value)%>"