Beginners Question Regarding Static Web Pages

Discussion in 'ASP .Net' started by Roger stevenson, Apr 30, 2005.

  1. 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 the old way
    Roger Stenson
    Roger stevenson, Apr 30, 2005
    1. Advertisements

  2. Roger stevenson

    Scott Allen Guest

    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?
    Scott Allen, May 1, 2005
    1. Advertisements

  3. 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
    Roger stevenson, May 1, 2005
  4. Roger stevenson

    Scott Allen Guest

    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,
    Scott Allen, May 1, 2005
  5. 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
    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 stevenson, May 2, 2005
  6. 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?
    Jordan Richard, May 2, 2005
  7. Roger stevenson

    Guest Guest


    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.
    Guest, Jun 30, 2005
  8. Roger stevenson

    Guest Guest


    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 );

    Add that code to an ASPX (rename the sample.html file to your own filespec)
    and you're in business.
    Guest, Jun 30, 2005
  9. Roger stevenson

    Sam Samnah Guest

    If you want want to build html from the browser you really need to implement
    the MSHTML Editor and run some client script.
    Sam Samnah, Jul 1, 2005
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.