In a message dated 1/20/03 1:59:16 PM, [EMAIL PROTECTED] writes:


I like the option as well.� I ocassionally have to translate .asp to .adp and
that would make it simpler.

It also makes if'ing large blocks of adp possible which I find handy.

Also, in my case having a partial display is less desirable than a 500 error
for many of my pages.


Another option might be to use more of the ns_adp_* procs, such as ns_adp_include and ns_adp_argv. We generally keep code and presentation separated as much as possible. Most of the logic in our applications is isolated in the .adp page, while html presentation is kept in what we call "include" files. Take the following simple example:

index.adp

<%
set name [ns_queryget name]

ns_adp_include inc/header.inc

if {[string length $name]} {
    ns_adp_include inc/step_2.inc $name
} else {
    ns_adp_include inc/step_1.inc
}

ns_adp_include inc/footer.inc
%>

header.inc and footer.inc would contain opening and closing html, and body tags, while step_1.inc and step_2.inc would contain the html for different forms. This model is pretty convenient in that it keeps the logic and presentation well isolated and keeps the application design relatively modular.

I can go into more detail if you are interested.

- Nathan

Reply via email to