How to communicate between module?

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.
9/22/2009 5:23:53 AM
Gravatar
Total Posts 17

How to communicate between modules?

Hi Joe

How are you?

Please advice me on following .

I want to pass value from one module to another module in the same page.

As for example I have a  Country dropdownlist in a module control. On changes value  another module's value will be changed.

I know using query string it is possible.But i don't want to post back ( Country Dropdownlist is in Update panel) .

Is there any way to load module dynamically on a  dynamic page from a module?

Is this clear to you?

So Please Advice .

Thanks and regards.

Anjan Maity

9/22/2009 6:19:28 AM
Gravatar
Total Posts 18439

Re: How to communicate between module?

I don't recommend trying to communicate across modules on a page, that is a very fragile approach because there is no guarantee that everything needed is on the page and as a matter of separation of concerns a module should not have any knowledge of other modules.

If you want a value in a module to change as a result of a change in a dropdown then that dropdown should be self contained inside the module. Modules/Features should be self contained and have no dependency on other modules being on the page.

The only communication strategy that I recommend is one that does not require specific knowledge of another module nor knowledge of what else is on a page. Like a Feed Manager can consume the rss feed from a blog module without any knowledge about the blog module other than its feed url. So there is communication by means of a feed but not communication somehow within the page and no knowledge of what else is on the page is needed.

Hope it helps,

Joe

9/22/2009 7:11:31 AM
Gravatar
Total Posts 17

Re: How to communicate between module?

Hi Joe

Thanks for early reply.

 

I have tried it as..

 private void displayCity( string val)

{

foreach (Control ctrl in this.Page.Master.FindControl("rightContent").Controls)

{

if (ctrl is MyModule)

{

 MyModule d = (MyModule)ctrl;

 

MyModule.City=val;

return;

}

}

}

and it is working.I have tried it in my workshop project. If i want to use in such a way in any  production site what may be the problem i have face to?

Please advice me.

 

Thanks and regards

Anjan Maity

9/22/2009 8:51:39 AM
Gravatar
Total Posts 18439

Re: How to communicate between module?

Hi,

As I said. I do not recommend communication across modules. My opinion is that features should be self contained.

It may be possible using approaches like you are trying, but just because its possible doesn't mean its a good idea. I recommend against it and have no recommendation of a good way to do it.

You are free to do as you wish, but that is my opinion.

Best,

Joe

9/22/2009 8:58:09 AM
Gravatar
Total Posts 17

Re: How to communicate between module?

Hi joe

Thanks again.

I always keep in mind your suggestion and follow strictly.

But it was my experiment. I am not implementing it any where.

Regards.

Anjan Maity

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