Click here to Skip to main content
15,886,860 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello sir,
after reading a html page,in this way

C#
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 = input;

after done that i store that html code into session

and pass this session to another page like that
C#
 String s = Session["abc"].ToString(); 
//Label1.Text = s;
CKEditorControl1.Text = s;

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.
Posted
Updated 21-Dec-11 1:13am
v3
Comments
[no name] 21-Dec-11 7:24am    
Why are you getting the html in one page and storing it in session state to pass to another page? Get the the html in the page you are going to use it with.

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
 
Share this answer
 
v2
using streamwriter to write a HTML code in another page .
 
Share this answer
 
Comments
Rohit Sharma706 21-Dec-11 7:43am    
thanks for reply sir,
streamwriter write a HTML code step by step. i got your answer but my problem is that i store the html code into session as you can see above.
that store html code i want to display it in design view like html page.
i hope you understand and you can help me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900