我想做的是这样的:
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_iframe_target
但是将在 iframe 上发送的 html 将是 msg 文件的 HTMLBody。
我尝试过的:
<html>
<body>
<div id="myDiv">
<label>sample</label>
<button>send</button>
</div>
<div id="2ndHTML">
(Insert html codes without replacing the above tags)
</div>
</body>
</html>
Default.aspx.cs:
MailItem item = (MailItem)app.CreateItemFromTemplate(@"C:\Users\elayronj\Desktop\Sample\sample.msg", Type.Missing);
samplediv.InnerHtml = item.HTMLBody;
已弃用 <xmp>
标记可用于在 HTML 页面中显示 HTML 代码,但不再是 XHTML 规范的一部分。它应该仍然适用于所有当前的浏览器。
查看此工作 fiddle
根据docs
The HTML Example Element () renders text between the start and
end tags without interpreting the HTML in between and using a
monospaced font. The HTML2 specification recommended that it should be
rendered wide enough to allow 80 characters per line.
正如文档中所说,
<xmp>
标记自 HTML3.2 以来已被弃用,并且未以一致的方式实现。它已从 HTML5 中的语言中完全删除,要实现功能,您可以使用
<pre>
元素,或者,如果语义足够,<code>
元素代替。请注意,您需要转义“<”字符
作为“<”以确保它不会被解释为标记。
- 也可以在任何元素上获得等宽字体,方法是应用
足够的 CSS 样式使用等宽作为通用字体值
字体系列属性。