Only FORM Merged In

It is tedious to merge HTML file into Web application, especially for the large HTML files with small HTML FORM associated to it. In such a HTML files, most portion of the file is HTML Headers, JavaScript, links, images, etc. These are static portion of a HTML file, they never change from time to time.

Here is an example: In the page HtmlSection, the HTML FORM is only 60% of the whole file, the others are header, JavaScript, images, links, and footer. For this file, the Web application only needs to deal with FORM if there are any fields need pre-inserted data.

WebRainbow has a special mechanism to handle such a case. It provides a dedicated function

to allow Web application to send several partial HTML files for creating the whole page. You can use this function along with CPrint to glue several static and/or dynamic pieces together to create the whole page on the fly.

Let's look at the demo, which is same as previous demo except the page layout and survey FORM are based on the page HtmlSection.

This demo includes several static pieces:

  1. HtmSec1.html (Header section)
  2. HtmSec2.html (Left column & Logo section 1)
  3. HtmSec3.html (Logo section 2)
  4. HtmSec4.html (Foot section)
  5. HtmSecF1.html (<FORM ACTION=...> for Survey Page)
  6. HtmSecF2.html (Section 2 of Survey FORM)
  7. HtmSecF3.html (Section 3 of Survey FORM)
  8. HtmSecL.html (<FORM ACTION=...> for Login Page)
  9. HtmSecS.html (JavaScript used for validating FORM fields)

and one dynamic piece

The HtmlSection.bas (or HtmlSection4.bas) calls SendHtmlFile several times to merge the static sections into the page.

To try this demo, follow the steps list bellow:

  1. Start Visual Basic

  2. Select Standard EXE as project type

  3. Select Sub Main as Startup Object

  4. Give HtmlSection as project name

  5. Set reference to WRHttpB.tlb, WRMimeB.tlb, and WRnbwB.tlb

  6. Remove Form1, which is the default form for new VB project

  7. Add HtmlSection.bas (source code for Visual Basic 5 & 6) or HtmlSection4.bas (source code for Visual Basic 4 32-bit), corresponding to the version of Visual Basic you used, into the Project HtmlSection. These two files are normally in the folder C:\Program Files\WebRainbow\demo\htmlsect\ if you did not change the installation directory for WebRainbow.

  8. Compile it to HtmlSection.exe.

  9. Click on Debug in VB IDE for detailed debug instruction.

  10. Click following link to

Good luck!


For the latest information on WebRainbow, please see:
http://www.dmfsys.com/wrainbow/

For questions / comments please email to:
support@dmfsys.com


Copyright © 2000 - 2005 D.M.F. Systems, Corporation. All rights reserved.

Last modified on March 2, 2005