I added an AJAX html editor to my ASP.NET web app and it is working fine. However, when I save the contents of the editor to my sql database it just saves the html. I need to save this as an html document. Is there a way to programatically save the contents as a document in the database, which can then be opened using my asp.net app? Also, is there a way to use the html editor to anchor sections of the text added in the editor?

我在我的ASP中添加了一个AJAX html编辑器。NET web应用,运行良好。但是,当我将编辑器的内容保存到sql数据库时,它只保存html。我需要将它保存为html文档。是否有一种方法可以编程地将内容保存为数据库中的文档,然后使用asp.net应用程序打开该文档?此外,是否有一种方法可以使用html编辑器来锚定编辑器中添加的文本部分?

Thank you for all your help,

谢谢你的帮助,

1 个解决方案

#1


3

Most html editors only insert snippets of html, so what you can do is take the contents of the editor and add into an html document, before inserting into the database.

大多数html编辑器只插入html片段,所以您可以做的是将编辑器的内容添加到一个html文档中,然后插入到数据库中。

string.Concat('<html><body>', editor_contents, '</body></html>');

You will have to modify this to suit your specific needs, but this should get you started. To anchor text you just need to add an id to the section you would like anchored.

您将不得不修改它以适应您的特定需求,但是这应该使您开始。要锚定文本,只需向希望锚定的部分添加id。

<a href="#someID">Go to section</a>
<div id="someID">Section</div>

更多相关文章

  1. [php]在PHP中读取和写入WORD文档的代码
  2. 最好的PHP IDE和PHP文本编辑器合集
  3. 在PHP中将PDF文档转换为预览图像,而无需安装Ghostscript
  4. 韩顺平_php从入门到精通_视频教程_学习笔记_源代码图解_PPT文档
  5. 【文档】五、Mysql Binlog事件结构
  6. MySql-5.5安装包及文档
  7. mysql官方文档之Range Optimization
  8. 数据库keepalived部署文档
  9. 设计html编辑器预览功能背后的理论

随机推荐

  1. 【代码实战】华为应用市场专家在线直播Ap
  2. 大新闻!Python 之父重新出山,加入微软开发
  3. 数据结构与算法: 三十张图弄懂「图的两种
  4. 1.5 万 Star!界面酷炫、简单易用的数据库
  5. centos 磁盘管理详解
  6. f-string 竟然能有 73 个例子,我要学习下
  7. 7 个省时高效的 pytest 特性和插件
  8. Android中JSON解析
  9. 再来 6 个例子教你重构 Python 代码
  10. Django2.0+小程序技术打造微信小程序助手