Html – Export ASPX to HTML


We're building a CMS. The site will be built and managed by the users in aspx pages, but we would like to create a static site of HTML's.
The way we're doing it now is with code I found here that overloads the Render method in the Aspx Page and writes the HTML string to a file. This works fine for a single page, but the thing with our CMS is that we want to automatically create a few HTML pages for a site right from the start, even before the creator has edited anything in the system.
Does anyone know of any way to do this?

Best Solution

I seem to have found the solution for my problemby using the Server.Ecxcute method.

I found an article that demonstared the use of it:

TextWriter textWriter = new StringWriter();
Server.Execute("myOtherPage.aspx", textWriter);

Then I do a few maniulatons on the textWriter, and insert it into an html file. Et voila! It works!

Related Question