Mathew Paul
Mathew Paul

Reputation: 663

html Text Editor Ajax control tool kit

I am using html editor from ajax control tool kit. When i get the content its giving me an html content withe all the formatting tags is it possible to get the preview content from this control. Thanks in advance

Upvotes: 0

Views: 1166

Answers (1)

Jon Egerton
Jon Egerton

Reputation: 41539

The preview is just an iframe that has been filled with the content html at the client side. There isn't really a "value" for the content other than this. If you just wanted the text you can probably parse this out of the content.

I think the content from this control is always well-formed (just did some testing here), so you can use xml:

//Load up the xml document
System.Xml.XmlDocument xml = new System.Xml.XmlDocument();
xml.LoadXML(myHTMLEditor.Content.replace(" ","")); //Replace entities with ""

//Get all the text
string s = xml.InnerText;

Note that this won't work in general for html - just the output from this control.

Upvotes: 2

Related Questions