where to set a development variable?

  • Thread starter Thread starter Keith G Hicks
  • Start date Start date
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
 
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>
 
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
 
Back
Top