PC Review


Reply
Thread Tools Rate Thread

Cms save problem when try to save the html page to server

 
 
fmakopo@investec.co.za
Guest
Posts: n/a
 
      23rd Jun 2006
Hi!

I am new to cms i am using this code to copy the whole page and save it
to C drive of mys server. When i am saving i am losing all cms content
from the page.

System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new
System.Web.UI.HtmlTextWriter(oStringWriter);
Page.RenderControl(oHtmlTextWriter);
oHtmlTextWriter.Flush();
System.IO.FileStream fs = new
System.IO.FileStream(@"C:\temp\test.htm",System.IO.FileMode.Create);

string s= oStringWriter.ToString();
byte[] b = System.Text.Encoding.UTF8.GetBytes(s);
fs.Write(b,0,b.Length);
fs.Close();
Response.End();

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 2002 save as menu says save as web page instead of just save as? Gary Microsoft Word Document Management 1 28th Jul 2006 03:26 PM
How to save html page using C# fmakopo@investec.co.za Microsoft C# .NET 2 22nd Jun 2006 05:21 PM
How to save html tags at SQL Server? Dexter Microsoft ASP .NET 7 10th Dec 2004 09:03 PM
can not save HTML page Anthony Windows XP Internet Explorer 1 18th Jul 2004 12:09 PM
how to save the out html to a html file on server disk automatically ? sincethe2003 Microsoft ASP .NET 2 14th Jul 2004 06:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:49 PM.