Modular design using ASP

Ask a Question related to ASP, Design and Development.

  1. #1

    Default Re: Modular design using ASP

    Mike,

    I don't follow this exactly. In your third paragraph, what is a concrete
    example of what you can do with PHP but not ASP?

    Paul

    "Mike" <sorry@sorry.com> wrote in message
    news:bh0h08$79s$1@geraldo.cc.utexas.edu...
    > I've been thinking about different ways to manage my site using ASP.
    We've
    > got a site redesign on the way and I'm just curious as to how others
    achieve
    > modular design.
    >
    > We'll have several hundred pages and I want each to have a similar
    layout...
    > common nav options on top, constituent nav options on the left side,
    > standard header, content to the right below the header and nav bar, etc.
    >
    > I want to achieve this by having individual directories for each page on
    the
    > site. Each directory would have an index that includes a template
    relative
    > to the site's root. That template would then include files relative to
    the
    > original index to give the page content. Works in PHP, not in ASP, thus I
    > can't go that route.
    >
    > I currently have directories for each page (with some exceptions here and
    > there) that have index files that build the overall page and include
    things
    > like a standardized header (relative to root), standardized footer
    (relative
    > to root), content (relative to index), left nav bar (relative to index in
    > parent directory), etc.. This works, but limits me if I want to change
    > something on every page (thus I have to change hundreds of index files).
    >
    > Anyone have another solution? I'd love to hear it.
    >
    > Thanks!
    >
    > --
    > Mike
    >
    >

    Paul Baker Guest

  2. Similar Questions and Discussions

    1. CGI scripts and modular design?
      Howdy, I've been poking through some different shopping cart software, trying to decide which one to use. All of them use piped filehandles or...
    2. Modular Text into Projector
      This is probably something simple, but I can't seem to make it work. I want to be able to create a Shockwave project that will end up being a CD...
    3. Modular Photoshop?
      Maybe this topic should be in the request section, but I think here it will get more attention and probably this suggestion is too dumb as I don't...
    4. I love a Publisher design, can I import the design into Frontpage?
      I'm establishing an identity for my new company using a Publisher design set. How do I use that basic design in Frontpage? Can I just creat a...
    5. Ideas for a modular config file?
      Hi folk, Right now I have a project that has a "bind-style" config file that is parsed with the aid of flex and bison. It looks a bit like this:...
  3. #2

    Default Re: Modular design using ASP


    "Paul Baker" <ask> wrote in message
    news:Oic0mpcXDHA.1280@tk2msftngp13.phx.gbl...
    > Mike,
    >
    > I don't follow this exactly. In your third paragraph, what is a concrete
    > example of what you can do with PHP but not ASP?
    The PHP code below works...

    ' some index.php buried several levels down
    <?php
    include( $_SERVER["DOCUMENT_ROOT"] . "/templates/_main.php" );
    ?>

    ' /templates/_main.php
    <?php
    include( "_data.php" ); <--- IN SAME DIR AS INDEX.PHP
    ?>
    <html>
    <head><title>TITLE</title></head>
    <body>
    include( "_content.php" ); <--- IN SAME DIR AS INDEX.PHP
    ?>
    </body>
    </html>

    The ASP code below doesn't work...

    ' some index.asp buried several levels down
    <!--#include virtual="/templates/normal.asp"-->

    ' /templates/normal.asp
    <!--#include file="./data.asp"--> <-- IN SAME DIR AS INDEX.ASP
    <html>
    <head><title>TITLE</title></head>
    <body>
    <!--#include file="./content.asp"--> <-- IN SAME DIR AS INDEX.ASP
    </body>
    </html>

    I can't seem to include relative to the parent file when using nested
    includes in ASP like I can when using PHP. I'd really like to be wrong or
    maybe have a misconfigured server, but the documentation I've read states
    that 'include file' includes the file that is located in the same directory
    as the file with the include statement.

    This isn't a slam on ASP or a PHP vs ASP attempt... I actually prefer ASP.
    I just saw something I liked in PHP that I wasn't able to duplicate in ASP
    on IIS 4.0.

    There are workarounds, but the only one that will allow me to use ASP code
    in the innermost included file is server.execute which isn't available until
    5.0 (we might move to IIS 6.0 but my Win2k3 trial server is currently
    offline so I haven't tested).

    --
    Mike


    Mike Guest

  4. #3

    Default Re: Modular design using ASP

    >The ASP code below doesn't work...
    >
    >' some index.asp buried several levels down
    ><!--#include virtual="/templates/normal.asp"-->
    >
    >' /templates/normal.asp
    ><!--#include file="./data.asp"--> <-- IN SAME DIR AS INDEX.ASP
    ><html>
    ><head><title>TITLE</title></head>
    ><body>
    ><!--#include file="./content.asp"--> <-- IN SAME DIR AS INDEX.ASP
    ></body>
    ></html>
    >
    >I can't seem to include relative to the parent file when using nested
    >includes in ASP like I can when using PHP. I'd really like to be wrong or
    >maybe have a misconfigured server, but the documentation I've read states
    >that 'include file' includes the file that is located in the same directory
    >as the file with the include statement.
    What doesn't work? And what do you see? Do you have URLScan running
    and possibly blocking the path? Have you tried just #include file =
    "myfile.asp" as the format (no path designator with the dot and
    backslash)?

    Jeff
    Jeff Cochran Guest

  5. #4

    Default Re: Modular design using ASP


    "Jeff Cochran" <jcochran.nospam@naplesgov.com> wrote in message
    news:3f33e677.8813803@news.easynews.com...
    > >The ASP code below doesn't work...
    > >
    > >' some index.asp buried several levels down
    > ><!--#include virtual="/templates/normal.asp"-->
    > >
    > >' /templates/normal.asp
    > ><!--#include file="./data.asp"--> <-- IN SAME DIR AS INDEX.ASP
    > ><html>
    > ><head><title>TITLE</title></head>
    > ><body>
    > ><!--#include file="./content.asp"--> <-- IN SAME DIR AS INDEX.ASP
    > ></body>
    > ></html>
    > >
    > What doesn't work? And what do you see? Do you have URLScan running
    > and possibly blocking the path? Have you tried just #include file =
    > "myfile.asp" as the format (no path designator with the dot and
    > backslash)?
    Active Server Pages error 'ASP 0126'
    Include file not found
    /templates/normal.asp, line 3
    The include file './data.asp' was not found.

    Active Server Pages error 'ASP 0126'
    Include file not found
    /templates/normal.asp, line 3
    The include file 'data.asp' was not found.

    I don't use URLScan on this server. I can also use the browser to load up
    data.asp. In addition, the whole thing works if I stick data.asp in the
    directory of the 2nd tier include file (normal.asp). This makes me think
    it's including relative to the 2nd tier include file and not the overall
    parent file.

    Thanks for the tips though.

    --
    Mike


    Mike Guest

  6. #5

    Default Re: Modular design using ASP

    if you use #include file then it looks relative to the file calling it. if
    you use #include virtual then it goes from the root.

    <!--#Include virtual="templates/normal.asp"-->

    note that there is no preceding slash (/) as it "knows" that it's relative
    to the root.


    "Mike" <sorry@sorry.com> wrote in message
    news:bh0pps$bii$1@geraldo.cc.utexas.edu...
    >
    > "Jeff Cochran" <jcochran.nospam@naplesgov.com> wrote in message
    > news:3f33e677.8813803@news.easynews.com...
    > > >The ASP code below doesn't work...
    > > >
    > > >' some index.asp buried several levels down
    > > ><!--#include virtual="/templates/normal.asp"-->
    > > >
    > > >' /templates/normal.asp
    > > ><!--#include file="./data.asp"--> <-- IN SAME DIR AS INDEX.ASP
    > > ><html>
    > > ><head><title>TITLE</title></head>
    > > ><body>
    > > ><!--#include file="./content.asp"--> <-- IN SAME DIR AS INDEX.ASP
    > > ></body>
    > > ></html>
    > > >
    > > What doesn't work? And what do you see? Do you have URLScan running
    > > and possibly blocking the path? Have you tried just #include file =
    > > "myfile.asp" as the format (no path designator with the dot and
    > > backslash)?
    >
    > Active Server Pages error 'ASP 0126'
    > Include file not found
    > /templates/normal.asp, line 3
    > The include file './data.asp' was not found.
    >
    > Active Server Pages error 'ASP 0126'
    > Include file not found
    > /templates/normal.asp, line 3
    > The include file 'data.asp' was not found.
    >
    > I don't use URLScan on this server. I can also use the browser to load up
    > data.asp. In addition, the whole thing works if I stick data.asp in the
    > directory of the 2nd tier include file (normal.asp). This makes me think
    > it's including relative to the 2nd tier include file and not the overall
    > parent file.
    >
    > Thanks for the tips though.
    >
    > --
    > Mike
    >
    >

    Tom B Guest

  7. #6

    Default Re: Modular design using ASP

    One site I've been working on has over 200 modules, and needs to be
    updated frequently and installed on multiple machines. It used to have
    files in different directories, but I removed all the directories
    (except a few for development-related files). Now, to get a list of the
    updated files for the day, I just sort the directory by file time, and
    copy that day's updated files to an 'updates-YYYY-MM-DD' directory.
    This update can be easily copy-pasted onto the other machines.

    Having all the ASP files in one directory also eliminates all file
    referencing problems related to directories, e.g. broken links when
    moving a file from one directory to another, or renaming a directory, or
    putting a file in a sub-directory. When one can assume that all the
    files are in the same directory, one eliminates a *lot* of mostly
    unnecessary work (in this case).

    To keep the files organized, they are named similarly depending on their
    major function. The major groups are list*.asp, change*.asp,
    include.*.asp, system.*.asp, *report.asp, etc.

    Functions that occur in many pages, are placed in the include files, and
    sometimes placed in a class within the include file. For example,
    include.documents.class.asp for dealing with documents. Any
    document-related file that needs these functions includes it like:

    <!--#include file="include.documents.class.asp"-->

    at the top of the page. Another example, the authentication and
    database include files are included by nearly every file.

    This program uses frames to acheive a consistent navigation interface.
    The top frame is a thin vertical bar of buttons, and the bottom frame is
    the content frame. The top frame is always visibile. To maintain a
    consistent style, every file includes a reference to a common style sheet.

    I think this program could be even better organized, but the current
    system seems to work well. If you were not using frames, you could
    place the navigation-related html code in an include file. Note that
    #include includes a file *before* the ASP code is executed.

    Good luck,
    Shailesh

    Mike wrote:
    > I've been thinking about different ways to manage my site using ASP. We've
    > got a site redesign on the way and I'm just curious as to how others achieve
    > modular design.
    >
    > We'll have several hundred pages and I want each to have a similar layout...
    > common nav options on top, constituent nav options on the left side,
    > standard header, content to the right below the header and nav bar, etc.
    >
    > I want to achieve this by having individual directories for each page on the
    > site. Each directory would have an index that includes a template relative
    > to the site's root. That template would then include files relative to the
    > original index to give the page content. Works in PHP, not in ASP, thus I
    > can't go that route.
    >
    > I currently have directories for each page (with some exceptions here and
    > there) that have index files that build the overall page and include things
    > like a standardized header (relative to root), standardized footer (relative
    > to root), content (relative to index), left nav bar (relative to index in
    > parent directory), etc.. This works, but limits me if I want to change
    > something on every page (thus I have to change hundreds of index files).
    >
    > Anyone have another solution? I'd love to hear it.
    >
    > Thanks!
    >
    > --
    > Mike
    >
    >
    Shailesh Humbad Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139