473,403 Members | 2,270 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,403 software developers and data experts.

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 2616
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
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
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
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
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
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
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
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
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
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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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
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,...

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.