CoverYourASP --> Snippets |
| "Snippets" are mini-articles - they allow me to very quickly add answers to your frequently asked questions, and add brief explanations for topics that you've searched for without success. So, everytime you send an email or perform a search, chances are a new snippet will be the result!22 Nov: How can I move some pages into sub-folders?Ken Hough asked how to modify the CYA code so that he could run some pages from sub-folders. There would be some pages in the root (e.g. default.asp!), some in an Articles folder, some in a Members folder, etc.First, keep the include and utils folders in the same place. Make two new files in the include folder - I call mine StartupRoot.asp and StartupChild.asp. Here are the contents of the files: StartupRoot.asp <%@ Language=JavaScript %> <!--#include file = "/Startup.html"--> StartupChild.asp <%@ Language=JavaScript %> <!--#include file = "/Startup.html"--> Then, include the relevant file in your pages. Instead of include/startup.asp, use include/StartupRoot.asp or ../include/StartupChild.asp Lastly, anytime you need to reference a file in a particular folder, use sRoot. One place you'll certainly need to change is the database path in Config.asp: var sDBPath = Server.MapPath ( sRoot + 'DBPATH/DB.mdb' ); |
|