在文本框中加载html内容 [英] load html content in textbox

查看:87
本文介绍了在文本框中加载html内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个html文件,例如example.htm。我可以将此html文件的内容加载到具有相同文本颜色和样式的文本框中吗?

解决方案

您无法在TextBox中执行此操作。但是可以使用浏览器控件来执行此操作。


是的,您可以在文本框中加载内容html。但它不会显示任何风格。只有原始的HTML。

如果你想显示样式而不是在div中加载html。

仅使用文本框来编辑html。



希望这对你有帮助。


如果你想在另一个html页面中显示html页面,你应该使用 iframe

http://www.w3schools.com/html/html_iframe。 asp [ ^ ]

如果你的要求是显示html标签,那么使用CDATA。

如果你需要语法高亮,那么使用语法高亮显示 http://alexgorbatchev.com/SyntaxHighlighter/ [ ^ ]

Hi all,
I have a html file say example.htm. can i load the contents of this html file to my textbox with same text colors and style?

解决方案

You cant do it in TextBox. But can use browser control to do it.


Yes, you can load content html in your text box. But it will not show any style. only raw html.
If you want to show the style load the html in a div instead.
Use textbox only to edit the html.

Hope this will help you.


If you want to display html page inside another html page then you should use iframe.
http://www.w3schools.com/html/html_iframe.asp[^]
If your requirement is to show the html tags, then use CDATA.
If you need syntax highlighting then use syntax highlighter http://alexgorbatchev.com/SyntaxHighlighter/[^]


这篇关于在文本框中加载html内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆