Home All Groups Group Topic Archive Search About

ASP classic -> ASP.NET 2.0

Author
25 Nov 2005 3:29 AM
Bob
In classic ASP, I used to keep a constant file that contains site
configuration settings.  For example,

Const SITE_BACKGROUND_COLOR = "#909090"
Const APPLICATION_NAME = "My Financial Site"
Const UPLOAD_DIRECOTRY = "C:\uploads\"

And then I'll include this constant file in all of my classic ASP pages.

From a code maintenance stand-point, if I need to carry site config settings
in ASP.NET C#, should I continue to carry a constant file as above?  Or is
there a better way.

Thank you!
ASP.NET C# Newbie

Author
25 Nov 2005 3:26 AM
Spam Catcher
"Bob" <spamfree@nospam.com> wrote in
news:ug4j28W8FHA.3504@TK2MSFTNGP11.phx.gbl:

> From a code maintenance stand-point, if I need to carry site config
> settings in ASP.NET C#, should I continue to carry a constant file as
> above?  Or is there a better way.

Web.config.


--
Stan Kee (spamhoneypot@rogers.com)
Are all your drivers up to date? click for free checkup

Author
25 Nov 2005 10:38 AM
Griff
On a related note....

I am writing a web application that I intend to host for several clients.

The idea is that I will have one folder containing all the code and a
separate web site for each client all using the same physical folder as the
home directory.

Each client will have their own SQL Server database and the idea is that
I'll know which DB to connect to based upon the Request.ApplicationPath
value.

What I'm not sure about is how to use the web.config file to contain
information that is web-site specific, e.g. if Client = A, use DB = A, if
client = B, use DB = B etc.

Is web.config where I should be storing this sort of information?

Griff
Author
26 Nov 2005 1:20 PM
prabhupr
How about mapping USER/Client login with a DB Mapping?
When the user logs in, they use a "Standard Login ID" to connect to a
"ADMINDB", from this "Admin DB" you get the DB name (for that user)
they are supposed to use starting then, you can then stored this DB
name as part of session variable

Also ensure you give bare minimum permission to this "Standard Login
ID" for that User<---->DB mapping table.


Griff wrote:
Show quoteHide quote
> On a related note....
>
> I am writing a web application that I intend to host for several clients.
>
> The idea is that I will have one folder containing all the code and a
> separate web site for each client all using the same physical folder as the
> home directory.
>
> Each client will have their own SQL Server database and the idea is that
> I'll know which DB to connect to based upon the Request.ApplicationPath
> value.
>
> What I'm not sure about is how to use the web.config file to contain
> information that is web-site specific, e.g. if Client = A, use DB = A, if
> client = B, use DB = B etc.
>
> Is web.config where I should be storing this sort of information?
>
> Griff

Bookmark and Share