如何保存添加到AJAX HTML编辑器中的文本,作为一个html文件?作为一个、器中、文本、编辑

由网友(月光柠檬)分享简介:我添加了一个AJAX HTML编辑器,我的ASP.NET web应用程序,这是工作的罚款。然而,当我编辑的内容保存到我的SQL数据库,它只是保存的HTML。我需要将其保存为HTML文档。有没有一种方法以编程的内容保存在数据库中的文档,然后可以使用我的asp.net应用程序打开?此外,有没有办法使用的HTML编辑器来固定...

我添加了一个AJAX HTML编辑器,我的ASP.NET web应用程序,这是工作的罚款。然而,当我编辑的内容保存到我的SQL数据库,它只是保存的HTML。我需要将其保存为HTML文档。有没有一种方法以编程的内容保存在数据库中的文档,然后可以使用我的asp.net应用程序打开?此外,有没有办法使用的HTML编辑器来固定在编辑器中添加的文本部分?

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?

感谢您的所有帮助,

推荐答案

大多数HTML编辑器只能插入HTML代码段,所以你可以做的就是把编辑的内容,并添加到HTML文档中,插入数据库之前

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.

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

您必须修改这个以满足您的特定需求,但这应该让你开始。为了锚文本,你只需要一个ID添加到您想挂靠的部分。

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.

<a href="#someID">Go to section</a>
<div id="someID">Section</div>
阅读全文

相关推荐

最新文章