473,761 Members | 10,684 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="builddeta iledreport.asp" -->
<%Else%>
<!-- #INCLUDE FILE="buildsumm ary.asp" -->
<%End if%>
Or would it be better to do a response.write?
<%If strReports = "Detailed" then
Response.write "<!-- #INCLUDE FILE='builddeta iledreport.asp'--> "
Else
Response.write "<!-- #INCLUDE FILE='buildsumm ary.asp' --> "
End if%>
Jul 19 '05 #1
3 3600

"middletree " <mi********@hto mail.com> wrote in message
news:%2******** *******@TK2MSFT NGP11.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="builddeta iledreport.asp" -->
<%Else%>
<!-- #INCLUDE FILE="buildsumm ary.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='builddeta iledreport.asp'--> "
Else
Response.write "<!-- #INCLUDE FILE='buildsumm ary.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********@hto mail.com> wrote in message
news:%2******** *******@TK2MSFT NGP11.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="builddeta iledreport.asp" -->
<%Else%>
<!-- #INCLUDE FILE="buildsumm ary.asp" -->
<%End if%>
Or would it be better to do a response.write?
<%If strReports = "Detailed" then
Response.write "<!-- #INCLUDE FILE='builddeta iledreport.asp'--> "
Else
Response.write "<!-- #INCLUDE FILE='buildsumm ary.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********@hto mail.com> wrote in message
news:#x******** *****@TK2MSFTNG P11.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="builddeta iledreport.asp" -->
<%Else%>
<!-- #INCLUDE FILE="buildsumm ary.asp" -->
<%End if%>
Or would it be better to do a response.write?
<%If strReports = "Detailed" then
Response.write "<!-- #INCLUDE FILE='builddeta iledreport.asp'--> "
Else
Response.write "<!-- #INCLUDE FILE='buildsumm ary.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
9614
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. What I call "shaking the broken tree" :) I chose to make my UT-generator in Python 2.4. However, I am now encountering problems in choosing the right parser for the job. I struggle in choosing between the inappropriate, the out-of-date, the...
13
1752
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 page web site that can take a few orders... INCLUDE THE ISP charges..developer, software...
1
1456
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 development with ASP.NET and could use some advice. The primary logic consists of copying and moving files both on the local computer, and servers across the enterprise. Is ASP.NET a good choice where a lot of file access and file IO is involved? Are...
25
2145
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 if the parameter model_name is "aa", then choose ModelAA. Currently I do this as follows:
19
2577
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 the right environment for this - running a wide variety of PHP applications. I realise that security is also important, but for now flexibility is more important to me. Note that I'm **not** looking for people to recommend hosting companies, I...
0
9521
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9945
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9900
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8768
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7324
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5361
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3863
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3442
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.