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. Advertisements

  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. Advertisements

  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. Advertisements

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. Chris P
    Replies:
    0
    Views:
    527
    Chris P
    Oct 28, 2003
  2. avishay

    Conditional compilation in VHDL

    avishay, Aug 1, 2005, in forum: VHDL
    Replies:
    4
    Views:
    3,343
    Andy Peters
    Aug 1, 2005
  3. vish
    Replies:
    2
    Views:
    2,061
    Steve C. Orr, MCSD
    Jul 16, 2003
  4. Praveen
    Replies:
    0
    Views:
    452
    Praveen
    Apr 12, 2005
  5. John M
    Replies:
    1
    Views:
    1,646
    Kumar Reddi
    May 29, 2005
  6. Alec S.
    Replies:
    10
    Views:
    11,231
    Alec S.
    Apr 16, 2005
  7. Steven T. Hatton

    Conditional compilation sans the cpp

    Steven T. Hatton, Aug 18, 2004, in forum: C++
    Replies:
    11
    Views:
    852
    Steven T. Hatton
    Aug 19, 2004
  8. Replies:
    5
    Views:
    551
    Sean Connery
    Jun 3, 2005
Loading...