473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

choosing an include file

I have a page which, according to the boss's instructions, needs to show one
of two things, based on which radio button was chosen on the previous page.
Because these 'things' are actually some chunks of code which contain sql
queries, loops, etc., I think it might be best to put each of them into an
include.

Will this work:

<%If strReports = "Detailed" then%>
<!-- #INCLUDE FILE="builddetailedreport.asp" -->
<%Else%>
<!-- #INCLUDE FILE="buildsummary.asp" -->
<%End if%>
Or would it be better to do a response.write?
<%If strReports = "Detailed" then
Response.write "<!-- #INCLUDE FILE='builddetailedreport.asp'--> "
Else
Response.write "<!-- #INCLUDE FILE='buildsummary.asp' --> "
End if%>
Jul 19 '05 #1
3 3580

"middletree" <mi********@htomail.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
I have a page which, according to the boss's instructions, needs to show one of two things, based on which radio button was chosen on the previous page. Because these 'things' are actually some chunks of code which contain sql
queries, loops, etc., I think it might be best to put each of them into an
include.

Will this work:

<%If strReports = "Detailed" then%>
<!-- #INCLUDE FILE="builddetailedreport.asp" -->
<%Else%>
<!-- #INCLUDE FILE="buildsummary.asp" -->
<%End if%>
This will work. Both files will be included, but only the code in the one
that is in the true condition will be executed.
Example:
include1.asp:
<% Response.Write "I'm included." %>
include2.asp:
<% Response.Write "I'm included, but not executed." %>

page.asp:
<% If 1 = 1 Then %>
<!-- #include file="include1.asp" -->
<% Else %>
<!-- #include file="include2.asp" -->
<% End If %>

That would be the same as:
<% If 1 = 1 Then %>
<% Response.Write "I'm included." %>
<% Else %>
<% Response.Write "I'm inlcluded, but not executed." %>
<% End If %>
Or would it be better to do a response.write?
<%If strReports = "Detailed" then
Response.write "<!-- #INCLUDE FILE='builddetailedreport.asp'--> "
Else
Response.write "<!-- #INCLUDE FILE='buildsummary.asp' --> "
End if%>


This will not work. All that would do is create a comment in your html
output. Include directives aren't part of the response, and they are
processed before any asp is.

Ray at work
Jul 19 '05 #2
"middletree" <mi********@htomail.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
I have a page which, according to the boss's instructions, needs to show one of two things, based on which radio button was chosen on the previous page. Because these 'things' are actually some chunks of code which contain sql queries, loops, etc., I think it might be best to put each of them into an include.

Will this work:

<%If strReports = "Detailed" then%>
<!-- #INCLUDE FILE="builddetailedreport.asp" -->
<%Else%>
<!-- #INCLUDE FILE="buildsummary.asp" -->
<%End if%>
Or would it be better to do a response.write?
<%If strReports = "Detailed" then
Response.write "<!-- #INCLUDE FILE='builddetailedreport.asp'--> "
Else
Response.write "<!-- #INCLUDE FILE='buildsummary.asp' --> "
End if%>


I would go with the first one since the second one simply prints out the
include directive. ;-p

-Chris Hohmann

Jul 19 '05 #3
www.aspfaq.com/2042

"middletree" <mi********@htomail.com> wrote in message
news:#x*************@TK2MSFTNGP11.phx.gbl...
I have a page which, according to the boss's instructions, needs to show one of two things, based on which radio button was chosen on the previous page. Because these 'things' are actually some chunks of code which contain sql
queries, loops, etc., I think it might be best to put each of them into an
include.

Will this work:

<%If strReports = "Detailed" then%>
<!-- #INCLUDE FILE="builddetailedreport.asp" -->
<%Else%>
<!-- #INCLUDE FILE="buildsummary.asp" -->
<%End if%>
Or would it be better to do a response.write?
<%If strReports = "Detailed" then
Response.write "<!-- #INCLUDE FILE='builddetailedreport.asp'--> "
Else
Response.write "<!-- #INCLUDE FILE='buildsummary.asp' --> "
End if%>

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Jean de Largentaye | last post by:
Hi, I need to parse a subset of C (a header file), and generate some unit tests for the functions listed in it. I thus need to parse the code, then rewrite function calls with wrong parameters....
13
by: nospam | last post by:
DEAR MICROSOFT: WOULD YOU PLEASE put up a web page showing the price list of EXPECTED COSTS for MOM & POP when choosing between MySql/PHP and .NET. FIRST: Show INITIAL COSTS for like a 5-10...
1
by: RJ | last post by:
I have developed numerous WinForm based utilities in .NET, but I wanted to consider a WebForm UI for my next utility, which runs only inside a corporate intranet. I have done only minimal...
25
by: David Sanders | last post by:
Hi, As part of a simulation program, I have several different model classes, ModelAA, ModelBB, etc., which are all derived from the class BasicModel by inheritance. model to use, for example...
19
by: hansBKK | last post by:
Upfront disclaimer - I am a relative newbie, just starting out learning about PHP, mostly by researching, installing and playing with different scripts. I am looking for a host that will provide...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.