473,669 Members | 2,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Conditionally including a file

Is there a way to conditionally include a file in the HTML?

<TD>
if x= 1 then
<!--#INCLUDE FILE="../File1"-->
else
<!--#INCLUDE FILE="../File2"-->
end if
</TD>
Nov 19 '05 #1
2 1250
ASP.NET doesn't use include files.

If you want to include either HTML or functions, then use user controls,
compiled assemblies or, in 2.0, source files in the App_Code directory.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
=============== =============== ========
"Craig" <No****@hotmail .com> wrote in message
news:Ow******** ******@TK2MSFTN GP11.phx.gbl...
Is there a way to conditionally include a file in the HTML?

<TD>
if x= 1 then
<!--#INCLUDE FILE="../File1"-->
else
<!--#INCLUDE FILE="../File2"-->
end if
</TD>

Nov 19 '05 #2
It is not for including asp.net code but for including Fireworks Pop-Up menu
code.
Thanks, anyway I got it working to include menu code based on the users
login.

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
ASP.NET doesn't use include files.

If you want to include either HTML or functions, then use user controls,
compiled assemblies or, in 2.0, source files in the App_Code directory.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Español : http://asp.net.do/foros/
=============== =============== ========
"Craig" <No****@hotmail .com> wrote in message
news:Ow******** ******@TK2MSFTN GP11.phx.gbl...
Is there a way to conditionally include a file in the HTML?

<TD>
if x= 1 then
<!--#INCLUDE FILE="../File1"-->
else
<!--#INCLUDE FILE="../File2"-->
end if
</TD>


Nov 19 '05 #3

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

Similar topics

2
1363
by: Sten Westerback | last post by:
Hi I'm considering using .asp to implement a selective inclusion of .htm files containing tables into a HTML code sent to browser from IIS. My question is if it is possible to make an .asp page that depending on two variables passed in the query (start-month and end-month) return to the browser a page that includes only files with names within the
8
8091
by: Yaro | last post by:
Hello Could anyone tell how can I drop table conditionally (UDB 8.2 Win) ? I have a script file create table_1@ create table_2@ etc.... I need add to this script statement like that
10
2474
by: SueB | last post by:
I currently have a 'mail-merge' process in my Access db project. It generates custom filled out Award Certificates based on an SQL SELECT statement in a VBA routine invoked by clicking on a command button. The "problem": I want to conditionally insert some text into the award certificate based on a field selected by the SELECT statement. Is this possible? Details: One of the fields selected is a concatenation of a value from a table
2
1336
by: Olav Tollefsen | last post by:
I'm creating an ASP.NET e-commerce web site and I have to conditionally (depending on site / user settings) display prices either excluding or including tax. Prices are typically read from a database (where also the tax rates are stored) various places in the code and typically (but now always) the values are returned in DataSets which are bound to controls and displayed to the user. What would be the most elegant way to implement the...
2
2704
by: Jens Weiermann | last post by:
Hi, I need to conditionally disable a html (not web forms) button control. The condition is to be evaluated server-side. What is the smartest way to do this? I'm now using a literal server-side control, conditionally placing the complete html code into the text property a lá If (SomeCondition) literal1.Text = "<INPUT type=\"button\" value=\"Something\">";
4
4227
by: John | last post by:
I need to read data from the file like the following with name and score, but some line may only has name without score: joe 100 amy 80 may Here's my code, but it couldn't read the line with "may" because there is no score. Anyone knows what is the workaround to this problem?
2
1300
by: Felix | last post by:
Hello, I use a #define like WITH_MYSTUFF to conditionally compile code within #ifdef WITH_MYSTUFF. I would now like the same define to conditionally link with a library. In the linker settings of VS.NET 2003 I have 'Input -> Additional Dependencies' where I can add my .lib files the linker should use. How do I tell the linker (by a macro ?) somthing like this:
7
13132
by: lister | last post by:
Hi, I have a situation where I have a large block of HTML code that is conditionally displayed. In effect I have: html page some html <?php if (bShowBlock)
2
2111
by: dohko8 | last post by:
Hi I would like to know how to load .js files conditionally? Suppose I have a Drop down box that is populated dynamically with A B C. When I select Element A I want it to load a .js file, B a different .js file and C a different .js. The js. files are not simply A.js, they are a reference to an URL address where they are stored. <select size='1' onchange="var si=this.selectedIndex; if(si){ addScript( this.options.value)}">...
0
8383
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8587
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
8658
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6210
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
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2792
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
2
1787
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.