我想将LOCAL HTML PAGE
加载到asp.net网络表单中的div中,并且没有必要使用空间解决方案。例如IFRAME
,JQUERY.LOAD()
等等。
我该怎么做?
注意:此HTML页面从数据库加载并上传到网络应用程序,因此我无法使用任何网址,例如www.foo.com
或http://localhost.
我很高兴听到最佳实践或任何想法或解决方案
感谢。
答案 0 :(得分:0)
asp:Literal
标记; Text
标记的asp:Literal
属性
醇>
实施例
形式:
<asp:Literal ID="myHtmlContent" runat="server"></asp:Literal>
代码背后:
protected void Page_Load(object sender, EventArgs e)
{
string html = "<div style='color:red'><b>Hello</b></div>";
// load HTML from DB insead
myHtmlContent.Text = html;
}
答案 1 :(得分:0)
最后在一些对话中使用哪个解决方案后,我用jquery.load()函数来做 上传我的HTML页面时,请使用以下功能调用它。
<script>
$(function () {
$("#includedContent").load("../HtmlHolder/index.html");
});
</script>
并将其放在此HTML标记中:
<div id="includedContent" class="reerer" style="width: 450px; height: 300px; border: 1px solid #808080; margin: 0px auto; overflow-y: scroll;"></div>
工作正常。