简体   繁体   中英

displaying email body as html in c# textbox

I am imitating my email client on a asp page. I have a gridview that displays things like from,subject,attachments, and the body. The body is html. When I view it in the grid view and set htmlencode= 'false' i can see it correctly. However, I want to the display it inside a textbox, so it can edit and forward it or reply.

Any ideas?

Thanks,

Load the HTML into a rich text editor to enable to user to edit it - be aware that most rich text editors out there are not designed to create email safe HTML and they will require a substantial amount of tweaking if you are going to support more than the most basic formatting.

Some example rich text editors:

研究使用像可爱编辑器这样的所见即所得(所见即所得)文本编辑

您需要使用HTML编辑器/ TextBox ,我们使用的是DevExpress组件,质量很高但不是免费的,还有Telerik或Infragistics之类的替代品,还有免费的替代品...请参见此处: 最佳免费的wysiwyg html编辑器

试试这个...您不能在文本框中显示html,但是可以获取源代码。我正在使用它:) 单击此处

You can try dinamycly add html code to page:

<div runat="server" id="myDiv">
</div>

and then set its InnerHtml property from the code-behind:

myDiv.InnerHtml = "your html here";

but with this way you cannot edit it...

if you are using Devexpress Controls,

you can use ASPxHTMLEditor.

It works exactly as your requirement is.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM