where to set a development variable?

K

Keith G Hicks

In my windows apps I always set a global development variable so that I can
toggle certain blocks of code back and forth between production and
development settings. I'll run some startup code that sets something like
DevVar = TRUE or DevVar = FALSE and then do this in code where needed:

If DevVar Then
....do something
ELSE
... do something else
END IF


I have no idea where to set something like (web.config, some global vb code
unit???) that in an asp.net 2.0 app and what it would be (session var??).
Looking for any advice.

Thanks,

Keith
 
K

Keith G Hicks

This is pretty much what I was looking for:

<configuration>
<!-- application specific settings -->
<appSettings>
<add key="connString" value="connection string" />
</appSettings>

<system.web>
...
</system.web>
 
M

Mark Rae [MVP]

This is pretty much what I was looking for:

<configuration>
<!-- application specific settings -->
<appSettings>
<add key="connString" value="connection string" />
</appSettings>

<system.web>
...
</system.web>

OK, but that's actually not what you asked for... You asked for a method to
use a variable to toggle *blocks of code*, and even gave an example of it,
which is why I gave you the Google link for articles on how to do
conditional compilation in ASP.NET...

If you are now saying that you want to be able to use, essentially,
different web.configs for development / production etc, then you need this:
http://weblogs.asp.net/scottgu/arch...-web-deployment-project-support-released.aspx
 

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

Forum statistics

Threads
474,183
Messages
2,570,965
Members
47,512
Latest member
FinleyNick

Latest Threads

Top