Import Namespace using conditional compilation symbols

  • Thread starter Thread starter Suresh
  • Start date Start date
S

Suresh

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.
 
How can I conditionaly set the other alias in the HTML side?

You cannot.
 
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?
 
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.
 
Back
Top