473,499 Members | 1,716 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 "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
<%@ Register TagPrefix="sfwg" Namespace="CustomNameSpace"
Assembly="CustomAssembly1.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 2618
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 "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
<%@ Register TagPrefix="sfwg" Namespace="CustomNameSpace"
Assembly="CustomAssembly1.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?frame=true

#Side-by-Side Execution Overview
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconSide-by-SideExecutionOverview.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
2439
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...
12
2457
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...
2
2568
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...
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"...
1
1484
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...
4
2789
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....
10
3068
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...
4
2073
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
2169
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
1
6892
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...
0
7385
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...
1
4917
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...
0
4597
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...
0
3096
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...
0
3088
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1425
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 ...
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
294
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...

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.