Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 无法将xhtml呈现到页面_C#_Asp.net_Xhtml - Fatal编程技术网

C# 无法将xhtml呈现到页面

C# 无法将xhtml呈现到页面,c#,asp.net,xhtml,C#,Asp.net,Xhtml,我试图从可爱的编辑器输出呈现xhtml,以便在我的页面中显示富文本。我正在尝试,但似乎对我不起作用 //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_D

我试图从可爱的编辑器输出呈现xhtml,以便在我的页面中显示富文本。我正在尝试,但似乎对我不起作用

//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);
}

看起来您正在将文本直接呈现到回收站(TextWriter.Null)

您应该写入正在生成的响应的输出流。试试这个(不知道它是否编译)

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