ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old June 17th, 2003, 10:22 AM
don_sparko's Avatar
don_sparko don_sparko is offline
Digitally Challenged
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 280 don_sparko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m 14 sec
Reputation Power: 6
Question prepending an asp file to every document in a directory

is there a way in asp that you can prepend a file to the beginning of page you access in a directory? i'm not talking about the include statement because you have to put it in on everypage manually. i know you can do this in cold fusion, but i don't know how to do it in asp or if its even possible

Reply With Quote
  #2  
Old June 17th, 2003, 10:43 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Do you mean

something like using FSO(File System Object) to read the content of a file and then prepend it ?

If so, use FSO, read the file you want then...voila! no?

Hope this helps!
Sincerely

Vlince

Reply With Quote
  #3  
Old June 17th, 2003, 10:54 AM
don_sparko's Avatar
don_sparko don_sparko is offline
Digitally Challenged
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 280 don_sparko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m 14 sec
Reputation Power: 6
not quite

ok here is what i'm thinking. i have to have an asp file be a part of the beginning of every file in a certain directory. it would work similar to an #include file="somefile.asp" accept i wouldn't have to put that in everyfile, the server would just automatically insert it at the beginning of every asp file requested. any other suggestions?

Reply With Quote
  #4  
Old June 17th, 2003, 11:33 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Well that's pretty much why include files are used but let's try something else.

You say:
-->i have to have an asp file be a part of the beginning of every file in a certain directory<--

When you say a *certain directory* I assume that you must have a layout like this:

wwwroot-->MySite

Then MySite has 3 sub directories
wwwroot-->MySite-->directory1
-->directory2
-->directory3

Let's say the files that are in a certain directory are inside the directory3 ok.

Assuming *directory3* holds 5 .asp pages
page1.asp
page2asp
page3.asp
page4.asp
page5.asp

The structure would then look something like:
wwwroot-->MySite-->directory1
-->directory2
-->directory3-->page1.asp
-->page2.asp
-->page3.asp
-->page4.asp
-->page5.asp

Now you want, for every asp pages inside *directory3*, prepend the content of another file right?

So why not have an asp file called *prepend.asp* inside *directory3* that you will include inside all 5 asp pages?


-->the server would just automatically insert it at the beginning of every asp<--

The server's job is to interpret the code(logic) *you* the programmer did(well its actually the .dll's job but you get it)
The server can't without some sort of indication(could be a Const, a QueryString parameter, cookie...) decide if he prepend something or not.

Since the .asp pages inside *directory3* are unique why not use the *prepend.asp* approach?

Unless I'm missing something...

Oh and what's the *content* that you are trying to prepend ?
Is it code? that must be interpreted?
Is it simple text?
What?

I'm curious

Hope this helps!
Sincerely

Vlince

Reply With Quote
  #5  
Old June 17th, 2003, 01:17 PM
don_sparko's Avatar
don_sparko don_sparko is offline
Digitally Challenged
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 280 don_sparko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m 14 sec
Reputation Power: 6
thanks for the suggestion. i'm doing a script to determine if the user is logged in. i've contemplated using the #include file, but i've already coded alot of pages and was hoping that there was an easier way than opening up each page to insert one line of code. as i said earlier if i was lucky enough to be using cold fusion, there is a special name you can give a .cfm file that will process it before anthing else is in the directory its in. really nice for changeing security scripts. just hoping there was a special case like that for .asp files. anyone know?

Reply With Quote
  #6  
Old June 17th, 2003, 01:24 PM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Well there is...they are called *include files*

Oh...wait perhaps...I just found something that *might* help you!

Have a look here:
http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=57

Hope this helps!
Sincerely

Vlince

Reply With Quote
  #7  
Old June 17th, 2003, 02:01 PM
don_sparko's Avatar
don_sparko don_sparko is offline
Digitally Challenged
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 280 don_sparko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m 14 sec
Reputation Power: 6
ok i guess i should be asking this a bit different. i have a directory we'll call it dir1. in dir1 i have a bunch of .asp files. now for each of these files i need to have something added to the beginning, no matter what the file is. in cold fusion, there is a special file name (as in its name is a reserved word, perhaps like global.asa) where you just name a file we'll say its called pre.cfm. all i have to do is put that special file in the same folder, and for every request for a file from that folder that file is automattically added to the beginning, without having to go into each file and adding an include file statement. can you do that with asp? make sense? is there a way to do it?

Reply With Quote
  #8  
Old June 17th, 2003, 02:15 PM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Ok this is more clear now

The answer to this is:
I don't know

Honestly I've never heard/seen anything like that so I'd have to say NO you can do that in asp like you claim you can in Cold Fusion.

There isn't a *magical* file that you put inside a *folder* that will affect all the folder's content.

When I say *magical* I'm being sarcastic but you got that...

What your asking is like the web.config file in .NET but the only thing that comes close to that in ASP is the global.asa file but then again I'ts NOT as versatile as the web.config file.


*Perhaps* and that is a BIG perhaps Application/Session variables could help but then again you'd have to code something...dont want to get you/me more confused here!

Hope this helps!
Sincerely

Vlince

Reply With Quote
  #9  
Old June 17th, 2003, 03:37 PM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 4 m 10 sec
Reputation Power: 75
Vlince is right, the way to include something at the beginning of your pages is with #include file. There isn't a way to automatically prepend like you asked about.

Reply With Quote
  #10  
Old June 18th, 2003, 09:02 AM
don_sparko's Avatar
don_sparko don_sparko is offline
Digitally Challenged
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 280 don_sparko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m 14 sec
Reputation Power: 6
thanks. its easier to move on once you know that something can't be done. happy coding.

word to your mother.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > prepending an asp file to every document in a directory


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway