-1

I need to create an HTML document (webpage) with anchors, and have that file saved somewhere, another program will be linking to these documents via their URL with the anchor syntax at the end so that they are directed to the correct part of the document.

What is the best way to do this? Do I programmatically generate the HTML document and insert the anchor points, then get the user to save this document on their server? How would I get the URL to the location of this document? I am using ASP.NET.

Or, do I just use an HTML text editor to save the HTML as a varchar(MAX) in the SQL database. BUT, if I do this, how can I add the anchors?AND, how can I read the HTML in a browser when it is stored as a long string in the database (I have yet to find anyone who knows the answer to that)? I have tried LITERALS and iFRAME but neither render the HTML content from the database.

I am thinking the best way is to programmartically generate the HTML document, this way I have control over entering anchor points (I don't think this is possible with the Ajax HTML editor). Then simply have the user save this document (webpage) anywhere they want on their computer/server. Then, if I have the URL, I can get this other program to go to that document, at the anchor point, by knowing the URL of its location.

4

1 回答 1

0

好吧,回答您的问题有几个不同的部分,但我想我可能会提供帮助(如果我误解了您的问题,我深表歉意)。

过去,我不得不做一些有限的网络工作,而一个似乎对我来说总是有效的解决方案是构建你的整个网页、布局和所有内容,只是没有内容。从那里,将所有文本存储到 Sql 数据库中的 varChar 槽中。这同样适用于存储 URL,因此这是您的锚问题的可能解决方案(这就是我跟踪图像 URL 的方式)。

至于在数据库中“存储”实际页面,我不确定这是可能的,或者即使你可以。只需像其他所有内容一样将页面存储在服务器上。除此之外,一个用于在页面和服务器之间存储和加载数据的简单后端就是让这样的系统启动并运行所需的一切。

由于您使用的是 ASP,我不能 100% 确定 sql 交互有多么困难,但在 PHP 中这是一项非常容易的任务。事实上,我已经设计并部署了一个基于 PHP 的接口客户端,如果你需要它,我很乐意与你分享——只需给我发消息。希望这至少有所帮助,我知道答案很模糊,但问题很复杂。

于 2012-11-19T15:34:59.157 回答