Import Namespace using conditional compilation symbols

Discussion in 'ASP .Net' started by Suresh, Jul 24, 2008.

  1. Suresh

    Suresh Guest

    Anyway to do the following in aspx HTML?

    Currently in my codebehind:

    #if SOMECONDITION
    using MYBL=MyNamespace.Biz
    #else
    using MYBL=MyNamespace.WebServiceBiz
    #endif

    Right now in the aspx I have
    <%@ Import Namespace="MYBL=MyNamespace.Biz" %>

    How can I conditionaly set the other alias in the HTML side?

    Thanks,
    Suresh.
    Suresh, Jul 24, 2008
    #1
    1. Advertising

  2. Gaurav Vaish \(a.k.a. MasterGaurav\), Jul 27, 2008
    #2
    1. Advertising

  3. What exactly are you trying to achieve here?

    It looks like you want to use one of two different implementations of
    some class or set of classes depending on a configuration value.

    There are lots of ways to accomplish this without using conditional
    compilation, from factory methods up to full-blown DI frameworks.

    What are the classes involved?
    Flinky Wisty Pomm, Jul 27, 2008
    #3
  4. Suresh

    Suresh Guest

    The current setup is to access the custom business objects directly or thru
    web services. We are using the compilation symbol setting at runtime to
    choose between the 2.

    If you that's what you understood can you explain more about factory methods
    and DI frameworks? In the meantime I'll search on these terms on google.

    Thanks,
    Suresh.

    "Flinky Wisty Pomm" wrote:

    > What exactly are you trying to achieve here?
    >
    > It looks like you want to use one of two different implementations of
    > some class or set of classes depending on a configuration value.
    >
    > There are lots of ways to accomplish this without using conditional
    > compilation, from factory methods up to full-blown DI frameworks.
    >
    > What are the classes involved?
    >
    Suresh, Jul 29, 2008
    #4
    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. Hossein Farkho
    Replies:
    1
    Views:
    493
    Karl Seguin
    Nov 30, 2005
  2. Alec S.
    Replies:
    10
    Views:
    10,084
    Alec S.
    Apr 16, 2005
  3. Kevin Howe
    Replies:
    1
    Views:
    1,267
    Thomas Heller
    Jun 26, 2003
  4. mk
    Replies:
    0
    Views:
    347
  5. Ray
    Replies:
    1
    Views:
    148
    Peter Michaux
    Jan 28, 2007
Loading...

Share This Page