ASP.NET Global.asax code doesn't execute

Discussion in 'ASP.NET / ASP.NET Core' started by Scott, Feb 1, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. When asp compiles your global.asax, it is given a the default class name, a name that I don't recall now and you have to use that class name to address your aplication variables since they are members of the class.

    Add the following to your global.aspx (using whatever you want to replace 'MyApp'):
    <%@ Application ClassName='MyApp' %>

    You can then define global variables, i.e.
    public shared MyConnString as string = '<the connection string'>

    Then in your application code, you can access the connection string with
    MyApp.MyConnString
     
  2. Thanks, I'll give it a try.
     
  3. I loaded my project on the server and the connection string is loaded into an application variable in the global.asax, b ut it doesn't execute. Anyone have an idea why?

    Appreciate any help.....

    soggy
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page