ASP Best Practices

Next Topic

Layout Order of Scripts

The following list summarizes the recommended layout of scripts in an .asp file, proceeding fromtop to bottom on the page . Well-ordered scripts produce more readable pages and, in some cases, cleaner execution. The list applies to both VBScript and JScript unless otherwise noted.

  • Specify the language.

  • Use the Option Explicit statement (VBScript only).

  • List function library includes.

  • Declare page-scoped variables.

  • Assign values to page-scoped variables.

  • Write HTML and inline scripting.

  • List functions called by inline scripts.

See the following: