如何在设计模式下查看html代码 [英] How to see html code into design mode
问题描述
先生您好,
阅读html页面后,以这种方式
Hello sir,
after reading a html page,in this way
string file = Server.MapPath("index.html");
StreamReader sr;
FileInfo fi = new FileInfo(file);
string input = "<pre>";
if (File.Exists(file))
{
sr = File.OpenText(file);
input += Server.HtmlEncode(sr.ReadToEnd());
sr.Close();
}
input += "
";
Label1.Text =输入;
完成后,我将该html代码存储到会话中
并将此会话传递给类似的其他页面
";
Label1.Text = input;
after done that i store that html code into session
and pass this session to another page like that
String s = Session["abc"].ToString();
//Label1.Text = s;
CKEditorControl1.Text = s;
我在其中使用CKEditor来获取此会话html代码的地方,但问题是我需要将html代码显示为进入设计模式的CKeditor.
所有的html代码都将转换为显示在设计视图中.然后,将其带到ckeditor中,在那里可以看到该会话html代码的设计.
如何编写会话html代码的另一件事.
那我该怎么做?
where I use a CKEditor to take this session html code, it come but problem is that i need to show that html code into design mode into CKeditor.
over all that html code convert to show into design view. Then I take it into ckeditor where I see the design of that session html code.
Another Thing how to write that session html code.
so how I do that? kindly you help me.
推荐答案
当我在会话中使用html代码时,它是incode值.
如果(File.Exists(file))
{
sr = File.OpenText(file);
输入+ = Server.HtmlEncode(sr.ReadToEnd());
sr.Close();
}
之后,我解码该incode html并将其放入ckeditor.
现在,我看到html代码进入了设计视图.
字符串s =会话["abc"].ToString();
字符串内容= Server.HtmlDecode(s);
//Label1.Text = s;
CKEditorControl1.Text =内容;
谢谢
when i take it html code in session,that came as a incode value.
if (File.Exists(file))
{
sr = File.OpenText(file);
input += Server.HtmlEncode(sr.ReadToEnd());
sr.Close();
}
after that i decode that incode html and take it into ckeditor.
now i see that html code into design view.
String s = Session["abc"].ToString();
string content = Server.HtmlDecode(s);
//Label1.Text = s;
CKEditorControl1.Text = content;
thanks
使用streamwriter在另一个页面中编写HTML代码.
using streamwriter to write a HTML code in another page .
这篇关于如何在设计模式下查看html代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!