简体   繁体   中英

Having trouble rendering xhtml to page

I am trying to render xhtml from cute editor output to display rich text in my page. I'm trying this but it doesn't seem to be working for me.

//ce_Document is my instance of cute editor
public void btn_SaveMessage_Click(object sender, EventArgs e)
{
    XhtmlTextWriter xtw = new XhtmlTextWriter(System.IO.TextWriter.Null);
    xtw.Write(ce_Document.XHTML);
}

Looks like you're rendering your text directly to the recycle bin (TextWriter.Null)

You should write to the output stream of the response you're generating. Try this (don't know if it compiles)

XhtmlTextWriter xtw = XhtmlTextWriter(new TextWriter(Response.OutputStream));

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