By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,672 Members | 1,628 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,672 IT Pros & Developers. It's quick & easy.

File Includes- Design problems

P: n/a
I have an ASP site with about 50 ASP files, all of which are currently
including a common "includes.asp" file near the top of the file, responsible
for generating the <HEAD/> section of the HTML

I need to make a change for 3 of those ASP files such that some dynamic HTML
is generated in the <HEAD/> section. I want those dynamic HTML to appear
only for 3 specific ASP files. Is there a more elegant way other than to
1) Dim strOptionalDymanmicHtml1 in includes.asp
2) Initialise strOptionalDymanmicHtml1 to "" in includes.asp
3) In the 3 ASP files which require additional optional dynamic HTML,
initiliase strOptionalDymanmicHtml1 *before* including includes.asp

There is an additional even more tricky problem, I have most file taking
this structure
ASPbeingView.asp including
- config.asp
- includes.asp

config.asp initialise a variable that is displayed in include.asp

However, there is one particular ASP file whose variable need to be
initialised in a different manner (within the ASPbeingView.asp). How could
I achieve this?

I have tried

1) Dim strDefault in config.asp
2) Initialise strDefault in config.asp
3) Dim strTemp in includes.asp
4) strTemp= strDefault in includes.asp
5) in the special ASP which need a different initialisation, I tried:
5.1) strTemp= "some other value",

but this doesn't work

Any thing other than making another copy of includes.asp and getting this
special ASP file to include this seperate includes.asp (which would make
includes.asp not very manageable- i would have to change includes.asp and
includesSpecial.asp for any future changes)!
Jul 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Parse request.servervariables("script_name") ... this will have the
including file, not the included file. Then you can just do a conditional
based on that.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Patrick" <pa**@reply.newsgroup.msn.com> wrote in message
news:#e**************@tk2msftngp13.phx.gbl...
I have an ASP site with about 50 ASP files, all of which are currently
including a common "includes.asp" file near the top of the file, responsible for generating the <HEAD/> section of the HTML

I need to make a change for 3 of those ASP files such that some dynamic HTML is generated in the <HEAD/> section. I want those dynamic HTML to appear
only for 3 specific ASP files. Is there a more elegant way other than to
1) Dim strOptionalDymanmicHtml1 in includes.asp
2) Initialise strOptionalDymanmicHtml1 to "" in includes.asp
3) In the 3 ASP files which require additional optional dynamic HTML,
initiliase strOptionalDymanmicHtml1 *before* including includes.asp

There is an additional even more tricky problem, I have most file taking
this structure
ASPbeingView.asp including
- config.asp
- includes.asp

config.asp initialise a variable that is displayed in include.asp

However, there is one particular ASP file whose variable need to be
initialised in a different manner (within the ASPbeingView.asp). How could I achieve this?

I have tried

1) Dim strDefault in config.asp
2) Initialise strDefault in config.asp
3) Dim strTemp in includes.asp
4) strTemp= strDefault in includes.asp
5) in the special ASP which need a different initialisation, I tried:
5.1) strTemp= "some other value",

but this doesn't work

Any thing other than making another copy of includes.asp and getting this
special ASP file to include this seperate includes.asp (which would make
includes.asp not very manageable- i would have to change includes.asp and
includesSpecial.asp for any future changes)!

Jul 19 '05 #2

P: n/a
Sorry, but not too sure what you mean by this, could you exemplify?

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:uP**************@tk2msftngp13.phx.gbl...
Parse request.servervariables("script_name") ... this will have the
including file, not the included file. Then you can just do a conditional
based on that.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Patrick" <pa**@reply.newsgroup.msn.com> wrote in message
news:#e**************@tk2msftngp13.phx.gbl...
I have an ASP site with about 50 ASP files, all of which are currently
including a common "includes.asp" file near the top of the file,

responsible
for generating the <HEAD/> section of the HTML

I need to make a change for 3 of those ASP files such that some dynamic

HTML
is generated in the <HEAD/> section. I want those dynamic HTML to appear only for 3 specific ASP files. Is there a more elegant way other than to 1) Dim strOptionalDymanmicHtml1 in includes.asp
2) Initialise strOptionalDymanmicHtml1 to "" in includes.asp
3) In the 3 ASP files which require additional optional dynamic HTML,
initiliase strOptionalDymanmicHtml1 *before* including includes.asp

There is an additional even more tricky problem, I have most file taking
this structure
ASPbeingView.asp including
- config.asp
- includes.asp

config.asp initialise a variable that is displayed in include.asp

However, there is one particular ASP file whose variable need to be
initialised in a different manner (within the ASPbeingView.asp). How

could
I achieve this?

I have tried

1) Dim strDefault in config.asp
2) Initialise strDefault in config.asp
3) Dim strTemp in includes.asp
4) strTemp= strDefault in includes.asp
5) in the special ASP which need a different initialisation, I tried:
5.1) strTemp= "some other value",

but this doesn't work

Any thing other than making another copy of includes.asp and getting this special ASP file to include this seperate includes.asp (which would make
includes.asp not very manageable- i would have to change includes.asp and includesSpecial.asp for any future changes)!


Jul 19 '05 #3

P: n/a
Hi Patrick,

How about a session variant? You may set the session variant at the very
beginning of ASPbeingView.asp. And then, include includes.asp. In
includes.asp, you can control the output based on the session variant. Can
this help?

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 19 '05 #4

P: n/a
You said you want includes.asp to be able to do something different when it
is in 2 or 3 ASP scripts, right?

So, in includes.asp:

<%
thispage = lcase(request.serverVariables("SCRIPT_NAME"))
if instr(thispage, "yourpage.asp")>0 then
' do something different
end if
%>

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Patrick" <pa**@reply.newsgroup.msn.com> wrote in message
news:Od**************@TK2MSFTNGP10.phx.gbl...
Sorry, but not too sure what you mean by this, could you exemplify?

"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:uP**************@tk2msftngp13.phx.gbl...
Parse request.servervariables("script_name") ... this will have the
including file, not the included file. Then you can just do a conditional
based on that.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Patrick" <pa**@reply.newsgroup.msn.com> wrote in message
news:#e**************@tk2msftngp13.phx.gbl...
I have an ASP site with about 50 ASP files, all of which are currently
including a common "includes.asp" file near the top of the file,

responsible
for generating the <HEAD/> section of the HTML

I need to make a change for 3 of those ASP files such that some dynamic
HTML
is generated in the <HEAD/> section. I want those dynamic HTML to

appear only for 3 specific ASP files. Is there a more elegant way other than to 1) Dim strOptionalDymanmicHtml1 in includes.asp
2) Initialise strOptionalDymanmicHtml1 to "" in includes.asp
3) In the 3 ASP files which require additional optional dynamic HTML,
initiliase strOptionalDymanmicHtml1 *before* including includes.asp

There is an additional even more tricky problem, I have most file
taking this structure
ASPbeingView.asp including
- config.asp
- includes.asp

config.asp initialise a variable that is displayed in include.asp

However, there is one particular ASP file whose variable need to be
initialised in a different manner (within the ASPbeingView.asp). How

could
I achieve this?

I have tried

1) Dim strDefault in config.asp
2) Initialise strDefault in config.asp
3) Dim strTemp in includes.asp
4) strTemp= strDefault in includes.asp
5) in the special ASP which need a different initialisation, I tried:
5.1) strTemp= "some other value",

but this doesn't work

Any thing other than making another copy of includes.asp and getting

this special ASP file to include this seperate includes.asp (which would make includes.asp not very manageable- i would have to change includes.asp and includesSpecial.asp for any future changes)!



Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.