Conditional Compilation Directives in aspx file?

Discussion in 'ASP .Net' started by Praveen Ramesh, Apr 12, 2005.

  1. 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
    Praveen Ramesh, Apr 12, 2005
    #1
    1. Advertising

  2. Praveen Ramesh

    Brock Allen Guest

    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/d...uide/html/cpconassemblyversionredirection.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
    Brock Allen, Apr 12, 2005
    #2
    1. Advertising

  3. 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-us/cpguide/html/cpconhowruntimelocatesa
    ssemblies.asp?frame=true

    #Side-by-Side Execution Overview
    http://msdn.microsoft.com/library/default.asp?url=/library/en-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.)
    Steven Cheng[MSFT], Apr 13, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Praveen
    Replies:
    0
    Views:
    360
    Praveen
    Apr 12, 2005
  2. Adrian
    Replies:
    1
    Views:
    392
    Eliyahu Goldin
    Mar 12, 2006
  3. Alec S.
    Replies:
    10
    Views:
    10,145
    Alec S.
    Apr 16, 2005
  4. Theon Greyjoy

    Preprocessor directives in codebehind file

    Theon Greyjoy, Oct 6, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,527
    bruce barker \(sqlwork.com\)
    Oct 6, 2006
  5. Replies:
    2
    Views:
    257
Loading...

Share This Page