Beginners Question Regarding Static Web Pages

R

Roger stevenson

Hi
I am a converting VB6 programmer. Having completed a Windows forms project ,
andbefore moving on to some of my ASP.Net projects I want to add a lot of
function to a VB 6 application that generates static web pages which display
segments of data bases. The applicaton is used by a lot of sporting bodies
that largelely get by on non-interactive free sites
I have just finished a quick skim through a book on Professional ASP dot net
looking for ways to do this. It is possible to use the function of Asp.Net
to generate the rendered output , save it in a file and then move on to
another form and do the same. Or do I write a module which finds the data
and generates the text output.in the old way
Roger Stenson
 
S

Scott Allen

Hi Roger:

I'm trying to understand your basic requirement.

Do you need to generate HTML files based on database content?
Or do you want to convert static content to something a little more
dynamic with ASP.NET web forms?
 
R

Roger stevenson

Thanks for your interest
I need to generate HTML Files which basically consist of a header section
and then a Table
The table contains , ranked results from competitions usuall having player
name on the left
maybe 10 results in the line then a performance section on the right
containing Sums, Averages, BestX's etc on the right

If it was an aspx page I was thinking I could get a Table from the database
contaiing the selected data, calculate the perfomance columns and then
just bind it to control on the form representing the table. Then all I need
to do is save the rendered output, ready for uploading.
There are typically about 10 of these tables published each week updated by
the week's performances.
I wrote the application for my own club. It proved very popular and I have
ended up running it for a lot of clubs. The next verssion is going to pull
all the club variants into a generalised common system and make it friendly
enough to hand it over to club secretaries to run
The system will add some pages to an otherwise static web site that needs
uploading to the web site by the club secretary

Roger Stenson
 
S

Scott Allen

Hi Roger:

Take a look at the DataGrid control in the ASP.NET toolbar. You can
bind this control to a SQL query that pulls records from the database.
The control will generate a table and is easy to customize, sort, and
page. A google search will give you lots of sample code to look at,
too.
 
R

Roger stevenson

Thanks very much. However you average club secretary is looking to click on
a (batch) run 'ProduceWeBPages' which runs down a schedule of his
requirements, generates all the related html files and puts them into an
output fule ready to upload to the web site.
Its the batch aspects of working through a schedule of pages and saving the
rendered output that I can not see how to do in an asp.net.system
The current system its a vb6 batch job that looks at the schedule, recovers
the data, clothes it in html and writes the html documents one by one.
Roger
 
J

Jordan Richard

Why in the world would you want to create an ASP.NET application that
generates static HTML pages. That can happen, but those static pages are
going to exist on the Web server - not the client - so your "average
secretary" isn't going to be able to then upload to their own Web site. It
sounds like your VB6 app is doing a great job. Can you clarify for us what
benefits you want to achieve by migrating this thing to ASP.NET?
 
G

Guest

Roger,

I have been searching for two days for articles that would give a clue as
how you can do this, but all have fallen short.

Essentially, what you're looking for is a way to take the standard
Response.Output stream and send it to a file that you define rather than back
to the client browser that requested it. By doing that, you can design a web
page using mostly static HTML and then run the web page in a loop, for
example, and produce 1000 static product pages.

let me know if you figure this out.
 
G

Guest

Roger,

I contacted a friend and we came up with this...

protected override void Render( System.Web.UI.HtmlTextWriter writer ) {
System.IO.TextWriter tw = System.IO.File.CreateText( @"c:\sample.html"
);
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter( tw
);
base.Render( hw );
tw.Close();
}

Add that code to an ASPX (rename the sample.html file to your own filespec)
and you're in business.
 
S

Sam Samnah

If you want want to build html from the browser you really need to implement
the MSHTML Editor and run some client script.
 

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

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top