Event Handler at application start

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
7/29/2009 10:47:29 AM
Gravatar
Total Posts 2

Event Handler at application start

 I just started playing with this portal and I was wondering how can I hook an event handler when the application starts with the purpose of loading some cached data without messing with the portal core like the Global.asax

Any help will be appretiated.

 

7/29/2009 10:57:55 AM
Gravatar
Total Posts 18439

Re: Event Handler at application start

You can implement a custom HttpModule in a separate class library or web app project so it compiles into your custom dll. I would use a post build event to copy your dll up to the Web/bin folder.

You can plug it in by adding it in the  Web.config <system.web><httpModules> section for IIS 6 and <system.webServer><modules> section in IIS 7 Integrated mode.

Inside the module you can hook into the application events. Note that the order in which the configured modules are listed in Web.config is the order they will execute, this can be important depending on what you are doing.

There are examples of custom HttpModules in mojoPortal source code, like Web/Components/BannedIPBlockingHttpModule.cs, you can see how it is plugged in by configuration in Web.config

Hope it helps,

Joe

7/29/2009 11:05:17 AM
Gravatar
Total Posts 2

Re: Event Handler at application start

I'll give it a try, Thanks 

You must sign in to post in the forums. This thread is closed to new posts.