Structure of a Page

An Asp page normally consists of server side scripts, client side scripts, HTML, and CCS.

I will try my best to

  • keep CCS external files
  • seperate server side scripts, client cripts, and HTML
  • put server side scripts at the top. only mix <%=varName%> and related if or loop clauses with HTML
  • put client side scripts all in <Head> section.

It will be very hard to separate server, client scripts, HTML if the dinamically generated controls need to have client side scripts associated with it.

 
 
Separation of Functionality

I tend to use two kind of ASP pages: one for display and one for process form data.

A display page gets data from session variables and database and generate HTML for displaying

An action page for a display page which is also a form gets posted data and does the processing, eg. update session variables or database.

advantage. The display page viewed by use can be refreshed