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

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Inject into Page_InitInject into Page_Init
Previous
 
Next
New Post
1/1/2014 6:04 PM
 

How can I inject a method to run in the page init event without modifying the code of every skin file used or tweaking default.aspx.cs? 

 

protected override void OnInit(EventArgs e) { 
 //my extra code here
 base.OnInit(e); 
}

 
New Post
1/2/2014 3:34 AM
 
You should do it by adding it to an extension - either the skin or a module displayed on all pages (eventually without any visual output).

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
1/2/2014 4:46 AM
 
Why do you want to do this?

I think you should do it in the skin. Relying on someone to remember to add a special module to every page is asking for trouble. Avoid duplication by inheriting all the skin derivatives from a common base class.

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
1/2/2014 11:15 AM
 

It sounds like it's impossible. I'm trying to find a way to inject it into the oninit event without refactoring the site contents (per Sebastian's suggestion) or the skin.

 
New Post
1/2/2014 2:55 PM
 

Hi,

It's not very simple.

But you can create a HttpModule which can add

a Page.Load or Page.Init

in the PreRequestHandlerExecute event

Regards,

Sacha

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Inject into Page_InitInject into Page_Init


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