rendering to html files

G

Guest

hi,
i have an idea to make admin tool on home computer, that would generate html
files using some kind of templates and database data and put these generated
html files to public web server, witch doesn't have running asp.net, using
ftp access.
why i need so?
because:
1) my project doesn't need to receive any data from browsing customers, it
will be only company news, info about new products - so it's enough to have
static html on webserver
2) web servers, witch doesn't have asp.net running are definetly cheaper,
even if i'll place on my own server, using scheme mentioned above i'll have
many advantages:

a) less traffic,
b) less server cpu
c) less security holes (no public access to any aspx, just html)
d) once again, no need to have asp.net on public web server

my question is:
how to make this happen, i couldn't find info about this approach. i could
write html tag by tag inserting database data, but that would be hard to
maintain and a lot of coding and so on. may be there's a nice way - let's say
1) i make regular aspx,
2) from admin tool i call some kind of method, that analysies that aspx
3) and generated html saves to html file

or smth like that?
 
N

Nathan Sokalski

I must say that I disagree with your reasoning, but if that's what you want
to do, that's your choice. As far as your question, I would look into the
HtmlTextWriter class. This makes it very easy to write html, it is what is
used by the ASP.NET Controls when generating the code that is sent to the
browser, but you could also use it to create a text file by changing where
it sends the output. This class inherits the TextWriter class, so if you
have used TextWriter (which is not hard once you've seen an example) you
shouldn't have any trouble learning HtmlTextWriter. But, like I said, I
disagree with your logic, it sounds like you might want to learn a little
bit more about ASP.NET. If your pages are generated from database data like
you said, wouldn't it be nice to have them automatically updated rather than
need to worry about making a new page every time a new product came out? If
you're trying to procrastinate learning ASP.NET, trust me, you'll regret it
someday.
 
G

Guest

i think you get my idea wrong, may be because of my english. page is updated
everytime, when user edits database - that's usual, but it won't be processed
by asp.net everytime user views it - that's not usual.

how often company produces/receives a new product? once a month? so, i need
to update page let's say once a month and it's viewed let's say 100 times a
month, so i think to have static html instead of rendering page everytime
user views it is quite clever. i know, asp.net has great caching features,
but that's another question.

anyway, i found more than a simple solution by my self - i just point
webrequest class from my admin tool to aspx page and i receive all the html
stream, witch i can write to file, so aspx pages are editable by visual
studio and i'm producing html files home, not at the web server.

regarding all the render html file, don't use php/aspx everytime page is
viewed approach, i think that's the way www.blogspot.com works, it saves data
in database and every time there's a new post it makes publishing, as i
called it "rendering to html file".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top