开发者

how can I get html code from selected text in asp.net?

开发者 https://www.devze.com 2023-03-17 06:09 出处:网络
I want to provide html email function in my application. But I don\'t know how to get html code from the text like

I want to provide html email function in my application. But I don't know how to get html code from the text like

<br /> <b>,开发者_高级运维 

etc. My application will provide user friendly user interface to let users to enter subject, email body and select attachment. The development environment is asp.net/c#. I use System.Net.Mail class to do email sending. I know I can write html email by using IsBodyHtml property, but how to get the html from the user interface?Does anyone have a solution?


Have you looked into the HTML Editor control provided by the ASP.Net AJAX Control Toolkit? It is probably the easiest route to give the editor a friendly interface to generate "rich text" with and for you to grab the underlying HTMl that generated it.

There are also numerous jQuery plugins available if you wish to go that route.


In fact, this is quite simple, I'd recommend you use some WYSIWYG Html Editor (or google "html editor for c#").

Basically, it writes html and javascript, for the textBox work as html editor, pretty the same when we are writing our questions and answer here in SO.


Have you looked for a Rich Text Editor that you can use for your users to enter their message (body)?

They usually have a function to get the HTML output of the text entered.

0

精彩评论

暂无评论...
验证码 换一张
取 消