473,624 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Conditional Compilation Directives in aspx file?

Hi,

Is there some kind of support for "Conditiona l Compilation Directives" in
the aspx file?

I want to enclose the Register tag as follows:
#if DOTNET10
<%@ Register TagPrefix="sfwg " Namespace="Cust omNameSpace"
Assembly="Custo mAssembly1.0"%>
#else
<%@ Register TagPrefix="sfwg " Namespace="Cust omNameSpace"
Assembly="Custo mAssembly1.1"%>
#endif

And of course be able to define the "DOTNET10" directive somewhere (maybe in
the web.config file).

TIA,
Praveen
Nov 19 '05 #1
2 2634
You should use assembly redirects as this is a built in way to get the version
you want via configuration. In essence this lets you configure in the config
file which version to use. Here's a link to the docs:

http://msdn.microsoft.com/library/de...edirection.asp

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi,

Is there some kind of support for "Conditiona l Compilation Directives"
in the aspx file?

I want to enclose the Register tag as follows:
#if DOTNET10
<%@ Register TagPrefix="sfwg " Namespace="Cust omNameSpace"
Assembly="Custo mAssembly1.0"%>
#else
<%@ Register TagPrefix="sfwg " Namespace="Cust omNameSpace"
Assembly="Custo mAssembly1.1"%>
#endif
And of course be able to define the "DOTNET10" directive somewhere
(maybe in the web.config file).

TIA,
Praveen


Nov 19 '05 #2
Thanks for Brock's inputs.

Hi Praveen,

So far there hasn't any conditional compilation directives in asp.net's
aspx page. And as for assembly's version redirect, .net has the formal
means through the assembly redirecting /binding configuration. And the
version redirection is actually a runtime behavior which occur at the
loading time of a certain assembly. Also, that assembly must be
strong-named so as to take advantage of the version redirections. Here are
some further resource on .net's assembly version redirection:

#How the Runtime Locates Assemblies
http://msdn.microsoft.com/library/en...untimelocatesa
ssemblies.asp?f rame=true

#Side-by-Side Execution Overview
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconSide-by-SideExecutionOv erview.asp

Hope also helps. Thanks,

Steven Cheng
Microsoft Online Support

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

Nov 19 '05 #3

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

Similar topics

11
2458
by: Steven T. Hatton | last post by:
I've made no secret of the fact that I really dislike the C preprocessor in C++. No aspect of the language has caused me more trouble. No aspect of the language has cause more code I've read to be difficult to understand. I've described it as GOTO's on steroids, and that's what it is!. One argument against abolishing it it that it is useful for conditional compilation when porting code, etc. Well, it seems to me C++ supports that...
12
2481
by: wanghz | last post by:
Hi, Could I ask some questions about the conditional compilaion? Suppose I have three simple files: a.c, b.c and c.h /* --------a.c--------- */ #include <stdio.h> #include "c.h" int main()
2
2583
by: FireStarter | last post by:
Guys, in the code that follows, why does the method F() still compile, even if DBG is undefined? Inside method G(), the code inside <#if DBG> does not compile (notice that I can write whatever I want in there, I will not receive a compilation error). I do get such an error in F() - because of the garbage I intentionally put there - but F() should not compile in the first place. Am I misusing this attribute?! #undef DBG
0
267
by: Praveen | last post by:
Hi, Is there some kind of support for "Conditional Compilation Directives" in the aspx file? I want to enclose the Register tag as follows: #if DOTNET10 <%@ Register TagPrefix="sfwg" Namespace="CustomNameSpace" Assembly="CustomAssembly1.0"%> #else
1
1495
by: Hossein Farkho | last post by:
I had a ASP.NET 1.1 project with 2 ".csproj" files, each one had different sets of compiler symbols (directives) so I could use the same code and compile two different versions of the project very easily. After converting to ASP.NET 2.0, since there is no project file, there is no way to set symbols in VS 2005 IDE. Now I am looking for a solution. I simply don't want to maintain two different code sets or change a constant manually...
4
2794
by: Bob | last post by:
Hi, In VS2003 conditional compilation constants and their state could be defined at project level. I was using this to control what features where offered by various builds. i.e. Feature1=true,Feature2=false, ... VS2005 seems to either allow the existance of the constant or not. ie. You must omit a constant not declare it to be false This means that the list no longer declares the state of all the options.
10
3085
by: Dave | last post by:
I'm a C++ programmer of many years, trying to get my feet wet in C#. I have a question about conditional compilation. In C++, I would sometimes define a constant in an include file, and then have blocks of code in different source files that were conditionally compiled based on that constant. Now that C# has done away with include files, is there any way of doing the same thing, short of defining the constant multiple times at the head...
4
2084
by: sam_cit | last post by:
Hi Everyone, I have a structure typedefed as typedef strcut { #if(MACRO == TRUE) int a; int b; #endif
1
2181
by: Sagaert Johan | last post by:
Hi Is there a constant i could use to force conditional compilation based on whether i compile for CF or the Full NET framework ? Johan
0
8236
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
8173
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
8335
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
8475
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
6110
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
4174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2606
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
1
1785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
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.