Home All Groups Group Topic Archive Search About
Author
11 Jun 2005 5:57 AM
Child X
Hi all,

I am still new to .net.
Coming from an asp classic background.

Using classic asp, i would use a include file to contain global variables
contained through out a site. These would normally be file system paths and
the like.

What would be the best approach to achieving this in dotnet.
Because they are only variables using a class seems overkills so does a user
control.

Thanks for any replies!!

Author
11 Jun 2005 10:09 AM
Saeid
If the variable is same to all users, so you can add them to the cach.
Regards
Saeid Kdaimati

Show quoteHide quote
"Child X" wrote:

> Hi all,
>
> I am still new to .net.
> Coming from an asp classic background.
>
> Using classic asp, i would use a include file to contain global variables
> contained through out a site. These would normally be file system paths and
> the like.
>
> What would be the best approach to achieving this in dotnet.
> Because they are only variables using a class seems overkills so does a user
> control.
>
> Thanks for any replies!!
Are all your drivers up to date? click for free checkup

Author
11 Jun 2005 2:00 PM
Brock Allen
Depends upon what youre global variable is for. If it's something like a
connection string, which was typically stored in global.asa in classic ASP,
then I'd suggest putting that value into the <appSettings> section of web.config.

http://www.dotnetjunkies.com/QuickStart/aspplus/default.aspx?url=/quickstart/aspplus/doc/configretrieve.aspx

If instead the variable is an actual constant, then I'd suggest looking into
static (C#)/Shared (VB.NET) variables. staic/Shared means there's one shared
copy of the variable for the entire application.

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> Hi all,
>
> I am still new to .net.
> Coming from an asp classic background.
> Using classic asp, i would use a include file to contain global
> variables contained through out a site. These would normally be file
> system paths and the like.
>
> What would be the best approach to achieving this in dotnet.
> Because they are only variables using a class seems overkills so does
> a user
> control.
> Thanks for any replies!!
>

Bookmark and Share