Import Namespace using conditional compilation symbols

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

Gaurav Vaish \(a.k.a. MasterGaurav\)

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

You cannot.
 
F

Flinky Wisty Pomm

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?
 
S

Suresh

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top