homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

converting generated asp code into html

 9:41 am on Feb 28, 2006 (gmt 0)


I have been searching for a solution for this problem for hours now and unfortunately I havent found anything which could help me...

What I want is:

I have got an .asp Page which has a high amount of data which is taken from a sql database. It takes about 30 to 40 seconds to display the results and thats way too long... What I want to do know is saving the html code which is generated for the clients on the server as a static html file...The fact that the html site will be static is no problem because the related asp site gets very very few updates...

Is there any possible way to realize this? I know I could write every line in a html file but isn't there a possible solutio for saving ALL the code AT ONCE?




 12:04 pm on Feb 28, 2006 (gmt 0)

Look into using VBScript's FileSystemObject to create an output file which you can save your data to. Once it's saved, you can then paste that code into your site file.


 12:29 pm on Feb 28, 2006 (gmt 0)

I already know that this is possible... Actually I wanted to know if it is possible to do this without having to save every line in a text file.

Hm... I thought about using the server.buffer object. Is there a possibility to get access to the information which is cashed in this buffer object?


 12:37 pm on Feb 28, 2006 (gmt 0)

You could save the HTML as a string in the Application object.

You probably don't want to save the html as an actual page because this means giving IUSR_computername (the anonymous browser account) write permissions in a directory


 12:44 pm on Feb 28, 2006 (gmt 0)

you're right. I dont wanna give anyone write-permissions for the server...

Hm if I would do it the way you propose, I would have to change the string in the application object manually everytime I made some changes/updates to the asp file right?

I'd like to realiz it the way that the static html code is always loaded especially anyone who has admin-rights changed something in the database. In this case the .asp script should run again and the new string should be saved as static html until the next changes. etc


 1:54 pm on Feb 28, 2006 (gmt 0)

Are you running SQLServer? You could have an exec in SQL Server that runs a Visual Basic program that writes the HTML page. That way you just need to give the SQLServer Agent some write permissions.


 4:25 pm on Feb 28, 2006 (gmt 0)

Second what iguana sez... I've got a couple of sql server tasks that build static web pages for me every hour. Those static files get wrapped with the standard template and nobody ever knows the difference.


 5:41 pm on Feb 28, 2006 (gmt 0)

Why not use wget to save the page to a html file?


 2:47 am on Mar 1, 2006 (gmt 0)

You could save the HTML as a string in the Application object.

If this is alot of data, the Application Object was not intended to be used as a repository for a 'large amount of data'. How much data are we talking about?

If there is alot of data (MB's?) What's taking the most time?

1) Reading the Data from DB
2) Rendering the HTML
3) Downloading the text (how much content? MB's?)

The reason I ask is if your SQL read is taking more than a few seconds, then there's a design issue in the Database, perhaps simply an Index needs to be added to a table. SQL can return thousands of results from multi-million record tables very quickly if they are designed and indexed properly.

If the rendering the HTML is taking too much time then Caching ASP Content [msdn.microsoft.com] will do what you need.

If you are downloading 2MB worth of text then your 30-40 second rendering is slow due to the amount of data you are pushing to the client.

Have you done a diff on the Ticks at the beginning of the page and then at the end (ie: how long process/rendering takes).

Global Options:
 top home search open messages active posts  

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved