How to call a function while running the setup?

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.
10/27/2012 9:29:09 AM
Gravatar
Total Posts 18

How to call a function while running the setup?

Hello Joe,

Is there any way to call a function from business layer while running the Set Up?

 

10/27/2012 10:37:52 AM
Gravatar
Total Posts 18439

Re: How to call a function while running the setup?

Not directly, but if you have a custom feature and you create a content installer for that feature then you could execute code from there.

Hope that helps,

Joe

10/28/2012 12:35:38 PM
Gravatar
Total Posts 2206

Re: How to call a function while running the setup?

If you only need to call your function when creating a site, you could use the Site Created Event Handler. The handler isn't documented yet but it works the same way as the "User Registered" handler, which is documented here.

HTH,
Joe D.

10/30/2012 8:55:50 AM
Gravatar
Total Posts 18

Re: How to call a function while running the setup?

Thanks for your help.
I have seen the document but I can't able to understand how can I call a function inside the content installer.
Can you please give me some example for calling a function in my content installer of my features.

And if I am using  Event Handler how it works.How can I call my function.For this also I need any example so that I can proceed in my work.

Thanks

Nivedita

 

10/30/2012 9:40:31 AM
Gravatar
Total Posts 1204
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: How to call a function while running the setup?

The beauty is that you don't have to call the Event Handler yourself. The way it works is that once your handler is registered in the site, when the target event occurs, your function will be automatically run by the system. To see a sample Site Created event handler, take a look at:

mojoPortal.Business.WebHelpers\SiteCreatedHandlers\DoNothingSiteCreatedEventHandler.cs

Also study the document Joe D. linked, for more background and how to register your new custom handler in your site.

Jamie

10/30/2012 1:03:08 PM
Gravatar
Total Posts 18439

Re: How to call a function while running the setup?

I've just created the documentation Site Created Event Handlers

Hope that helps,

Joe

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