Ask a Question related to ASP, Design and Development.
-
Paul Baker #1
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...We've> I've been thinking about different ways to manage my site using ASP.achieve> got a site redesign on the way and I'm just curious as to how otherslayout...> modular design.
>
> We'll have several hundred pages and I want each to have a similarthe> 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 onrelative> site. Each directory would have an index that includes a templatethe> to the site's root. That template would then include files relative tothings> 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(relative> like a standardized header (relative to root), standardized footer> 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
-
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... -
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... -
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... -
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... -
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:... -
Mike #2
Re: Modular design using ASP
"Paul Baker" <ask> wrote in message
news:Oic0mpcXDHA.1280@tk2msftngp13.phx.gbl...The PHP code below works...> 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?
' 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
-
Jeff Cochran #3
Re: Modular design using ASP
>The ASP code below doesn't work...
What doesn't work? And what do you see? Do you have URLScan running>
>' 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.
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
-
Mike #4
Re: Modular design using ASP
"Jeff Cochran" <jcochran.nospam@naplesgov.com> wrote in message
news:3f33e677.8813803@news.easynews.com...Active Server Pages error 'ASP 0126'> What doesn't work? And what do you see? Do you have URLScan running> >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>
> >
> and possibly blocking the path? Have you tried just #include file =
> "myfile.asp" as the format (no path designator with the dot and
> backslash)?
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
-
Tom B #5
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...>> > What doesn't work? And what do you see? Do you have URLScan running> > >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>
> > >
> > 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
-
Shailesh Humbad #6
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



Reply With Quote

