我想將LOCAL HTML PAGE
加載到asp.net web表單中的div中,並且不需要使用空間解決方案,例如IFRAME
,JQUERY.LOAD()
等等。
我該怎麼做?
注:從DB這個HTML頁面加載,並上傳到Web應用程序,所以我不能使用任何URL如www.foo.com
或http://localhost.
我,很高興聽到最佳做法或任何想法或解決方案。
謝謝。在asp.net中將本地html加載到div中
-1
A
回答
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>
它工作得很好。
0
- 將
asp:Literal
標記添加到您的表單; - 加載從DB你的HTML標記一個局部變量
- 從局部變量
例
表初始化asp:Literal
標籤的Text
屬性:
<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. 將ajax留言本加載到DIV中
- 2. 在UIWebview中加載本地html文件
- 3. 在UIWebView中加載本地html頁面
- 4. 將MathJax加載到加載的div中
- 5. 將html或div的內容加載到div中
- 6. 如何將本地html文件加載到Jsoup中?
- 7. 如何將本地html文件加載到j2me中?
- 8. 從html格式加載文本到div
- 9. 在加載頁面時在webview中加載本地html文件
- 10. 將外部HTML加載到DIV
- 11. 將HTML/PHP加載到div,iframe替代
- 12. 加載HTML鏈接到div?
- 13. 加載本地html文件到Pyside QwebView
- 14. 在div中加載html頁面
- 15. 單獨在HTML中重新加載div
- 16. 在div中加載html和php頁面
- 17. 將HTML加載到Android中的webview中?
- 18. 將html加載到包含javascript的div中
- 19. 將html文件的內容加載到div中?
- 20. 如何將數據加載到HTML div標記中?
- 21. 將HTML內容加載到div中的動畫效果
- 22. 如何將html加載到隱藏的div中?
- 23. 將本地HTML文件從項目中的my.resources加載到WebBrowser控件中 - vb.net
- 24. 將遠程html加載到div容器中,但阻止它加載內容
- 25. 將外部html加載到div中 - 頁面加載然後變爲空白
- 26. jQuery將外部swf加載到div中
- 27. 將外部文件加載到div中
- 28. jquery將aspx加載到div中
- 29. jquery mobile - 將內容加載到div中
- 30. 當使用jQuery .load在該DIV中更改HTML時,將初始HTML加載到DIV中