Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0How to add code to Application_Start()?How to add code to Application_Start()?
Previous
 
Next
New Post
9/6/2007 4:56 PM
 
Hi,

I need to add code to Application_Start() that sets a global variable of a specific component to configure it's license.
This could easily be done by adding one line of code to Application_Start() event in global.asax.vb:

PeterBlum.PetersDatePackage.Globals.LicenseKey = "999-111222333|MarsServer"

Since global.asax.vb doesn't exist... how is the right way to do it in DNN?

Thanks in advance,
Nuno
 
New Post
9/6/2007 8:31 PM
 

Its in the \App_Code\ folder where it should be for a asp.net 2.0 dynamic compile.

But frankly - you really should avoid playing with any part of the DNN core sites it leads to problems with DNN upgrades.

Westa

 
New Post
9/7/2007 4:15 AM
 
Yes, I really wanted to avoid messing up things in DNN core.
Isn't there any other way? Maybe a declarative way somehow?

My only alternative would be to do this in Page_Load of all pages that use this component.

Nuno

 
New Post
9/7/2007 7:02 AM
 

See my blog on this very topic - Simulating Application_Start event


Joe Brinkman
DNN Corp.
 
New Post
9/9/2007 4:31 AM
 
Thank you so much for all the help. Actually I decided to keep it simple and follow Peter Blum's advise which is to add the code to the Page_Load of each page which uses this component. It's only used in 7 places. It's simple and it doesn't change DNN core.

Nuno
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0How to add code to Application_Start()?How to add code to Application_Start()?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out