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.0AddModuleMessage from custom controlAddModuleMessage from custom control
Previous
 
Next
New Post
4/23/2007 11:06 AM
 

 Currenty i have a main page where i load some custom controls in:

  case "ViewTest":
                        ViewTest viewTest = (ViewTest)this.LoadControl(this.ModulePath + "test.ascx");
                        viewTest.ModuleConfiguration = this.ModuleConfiguration;
                        viewTest.ID = System.IO.Path.GetFileNameWithoutExtension(this.ModulePath + "test.ascx");
                        UCPanel.Controls.Add(viewTest);
                        ModuleConfiguration = viewTest.ModuleConfiguration;
                        RadTabStripEvent.SelectedIndex = 1;
                        break;


the problem is that from within te viewtest.ascx i cannot use AddModuleMessage, is just doesn't show, i know its because of the way i load my modules, but is there a work around ?

 
New Post
4/27/2007 6:28 PM
 

Although you did not indicate the base class for ViewTest.ascx, it would appear that it is derived from PortalModuleBase. However, since ViewTest.ascx is not "really" a module on the page, you might try to supply the Parent property of the ViewTest class (appropriately cast as PortalModuleBase) as the first parameter of AddModuleMessage when it is called from within ViewTest. Something like this (untested):

DotNetNuke.UI.Skins.Skin.AddModuleMessage((PortalModuleBase)this.Parent

, "Testing Message", Skins.Controls.ModuleMessage.ModuleMessageType.GreenSuccess);


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
4/28/2007 1:17 PM
 

I just went through the same problem in our latest module digContest.  You need to reference the Grandfather, not the parent :)  Here is the function I use:

        public void AddModuleMessage( string message, DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType type )
        {
            DotNetNuke.UI.Skins.Skin.AddModuleMessage((PortalModuleBase)this.Parent.Parent, message, type);
        }

Good luck!

Thanks,

Mike

 
New Post
5/1/2007 3:52 AM
 

The parent.parent did the trick! Thanks

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0AddModuleMessage from custom controlAddModuleMessage from custom control


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