Accessing the Global.asax

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a solution that has 3 projects in it. A web application called
USITracking. A project library holding my business logic classes and a
project library holding my data logic classes. From my business logic
classes how can I assess the global.asax?
 
You would have to add a reference to the web project from your business
logic class, and then access the class (specified by the ClassName
attribute in the global.asax).
But that sounds like a bad idea. Your business logic classes shouldn't
know about or depend on anything in your web application. You might
want to think about other ways to accomplish what you are trying.
 
I am trying to access my configuration settings in web.config to get my
connection string to the database.
 
You can read the configuration settings in web.config from your business
logic directly. ConfigurationSettings.AppSettings and
ConfigurationSettings.GetConfig can both read the settings from
web.config from any assembly running in the website process - which
includes your business logic library.
 
Back
Top