html文档中包含有表示,如何在html文档中包含html代码?

but the html that will be send on iframe will be the HTMLBody of an msg file.

What I have tried:

sample

send

(Insert html codes without replacing the above tags)

Default.aspx.cs:

MailItem item = (MailItem)app.CreateItemFromTemplate(@"C:\Users\elayronj\Desktop\Sample\sample.msg", Type.Missing);

samplediv.InnerHtml = item.HTMLBody;

Talk1:

Why not just type them there? Are you trying to do this programmatically? Can you show the code if so?

Talk2:

- flagged as not-constructive.

Talk3:

Talk4:

pls see default.aspx.cs for the code. Thanks.

Talk5:

Can you change the template to include some value (e.g. a GUID) in the place where you want to insert the new HTML?

Solutions1

The deprecated

tag can be used to show HTML code inside an HTML page but is no longer part of the XHTML spec. It should still work though in all current browsers.

See this working fiddle

According to the 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.

As said in the docs,

The

tag has been deprecated since HTML3.2 and was not implemented in a consistent way. It was completely removed from the language in HTML5 and to achieve the functionality, you can use

the

 element or, if semantically adequate, the 

element instead. Note that you will need to escape the '

as '

A monospaced font can also be obtained on any element, by applying an

adequate CSS style using monospace as the generic-font value for the

font-family property.

Talk1:

isn't the output of the tags inside xmp is in all text?

Talk2:

sorry...didnt get you..

Talk3:

why is the answer downvoted?

Talk4:

I didn't downvote, but I'm pretty sure the the guy is asking just how to escape < and >, not how to use an esoteric feature.

Talk5:

could you please explain to me, the reason why the tag is deprecated..

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值