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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...about DotNetNuke module about DotNetNuke module
Previous
 
Next
New Post
9/24/2008 1:29 PM
 

CategoryPage.ascx is a user control is it not a URL that you can redirect to.

1. the best way to do what you want is to use inter-process communnications, where one module 'sends' a message to the other who is 'listening' for messages. This works if the two modules are on the same page.

2. the other way will work as well, however you need to redirect to the 'page' that the two modules are living on. For example, if the tabid of the page where the two module are was, 52, then you would do a

Response.Redirect("/DotNetNuke1/tabid/52/path/" & TreeView1.selectedValue & "/Default.aspx")

 
New Post
9/24/2008 1:37 PM
 

just a suggestion, obviously it's not a good idea to hard-code the tabid like I did in my example, you should use the current tab id to build your redirect string

Dim oPortalSettings As PortalSettings = CType(HttpContext.Current.Items("PortalSettings"), PortalSettings)
Dim sTabID as String= oPortalSettings.ActiveTab.TabID.ToString()
Dim sUrl as string = "/DotNetNuke1/tabid/" & sTabID & "/path/" & TreeView1.selectedValue & "/Default.aspx"
Response.Redirect(sUrl)

 

 

 

 
New Post
9/24/2008 2:00 PM
 

ok, so that was the quick and dirty way to do it. A Response.Redirect will work but the proper way is IMC. Here's how you do that..

You have 2 modules, 1 will be the 'Sender' and 1 will be the 'Listener'

In the 'Sender' module, in the class declaration, implement the IModuleCommunicator interface, and declare a Public event

    Public MustInherit Class RepositoryDashboard
        Inherits Entities.Modules.PortalModuleBase
        Implements Entities.Modules.IActionable
        Implements Entities.Modules.IPortable
        Implements Entities.Modules.ISearchable
        Implements Entities.Modules.Communications.IModuleCommunicator

 Public Event ModuleCommunication(ByVal sender As Object, ByVal e As
    DotNetNuke.Entities.Modules.Communications.ModuleCommunicationEventArgs) Implements
    DotNetNuke.Entities.Modules.Communications.IModuleCommunicator.ModuleCommunication

Now in response to an event within the Sender module, such as selecting an item in your treeeview control, you want to send a 'message' to the 'Listener' module.

Dim moduleCommunicationEventArgs As New ModuleCommunicationEventArgs
moduleCommunicationEventArgs.Sender = "MySenderModule"
moduleCommunicationEventArgs.Target = "MyListenerModule"
moduleCommunicationEventArgs.Value = TreeView1.SelectedValue
moduleCommunicationEventArgs.Type = "CategoryChanged"
RaiseEvent ModuleCommunication(Me, moduleCommunicationEventArgs)

Now, we move to the 'Listener' module. This is the one that will listen for Events

First, the Listener must Implement the IModuleListener interface

    Public MustInherit Class MyListenerModule
        Inherits Entities.Modules.PortalModuleBase
        Implements Entities.Modules.IActionable
        Implements Entities.Modules.IPortable
        Implements Entities.Modules.ISearchable
        Implements Entities.Modules.Communications.IModuleListener

Then declare a Public Sub that will be executed when a mesage is received

Public Sub OnModuleCommunication(ByVal s As Object, ByVal e As ModuleCommunicationEventArgs) Implements
    IModuleListener.OnModuleCommunication
' only handle messages that are sent from my Sender module and only if they are for CategoryChanged
  If e.Sender = "MySenderModule" And e.Type = "CategoryChanged" Then
    ' get the value passed as part of the message
    Dim sPath as string = e.Value.ToString()
    ' do whatever you need to do here...
  End If
End Sub

Now, when you click on your treeview to select a new catgeory, your Sender module will raise an event. The Listener module will receive the event, verify that it was indeed the Sender that sent the message and that the message is for a category change, then the Listener can look at the Value property of the message to see what the selected category was.

So, now you have 2 ways to solve your problem. You can use response.redirect or inter-process communications. Use whichever one you feel works best for you.  I would suggest that if you are sure the 2 modules will be on the same page, use IMC, if not, use Redirect.  My Repository module actually performs a check to see if the two modules are on the same page and will use either IMC or redirect as approriate.

 
New Post
9/24/2008 3:39 PM
 

Steve,

Thank you for spending the time to provide this excellent IMC explanation.

 
New Post
9/27/2008 12:57 AM
 

So thank sir ,

  after i impliment  both way i send reply , actualy i very happy you  given solution me. good day..

   

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...about DotNetNuke module about DotNetNuke module


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