Hi Mona,
So you want a action for every module using your container ?
I use a skin object in a container to add an button to all my modules that are using that particular container.asxc
In the container ascx I made an reference to the skin object.
<%@ Register TagPrefix="dnn" TagName="HIDEMODULE" Src="Objects/HideModule.ascx" %>
and place the button somewhere in the ascx
The skinobject looks like this :
.ascx
<%@ Control language="vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Controls.HideModule" CodeFile="HideModule.ascx.vb" %>
.ascx.vb
Imports DotNetNuke.Entities.Tabs
Imports DotNetNuke
Imports DotNetNuke.Data
Namespace DotNetNuke.UI.Skins.Controls
''' -----------------------------------------------------------------------------
'''
'''
'''
'''
''' [cniknet] 10/15/2004 Replaced public members with properties and removed
''' brackets from property names
''' ''' -----------------------------------------------------------------------------
Partial Class HideModule
Inherits UI.Skins.SkinObjectBase
Const MyFileName As String = "HideModule.ascx"
Dim iCustomerid As String = 3
Dim iTab As Integer = 1
Dim iUserId As Integer
#Region " Web Form Designer Generated Code "
Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
'*******************************************************
' The Page_Load server event handler on this page is used
' to populate the role information for the page
'*******************************************************
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objUserInfo As UserInfo = Global.DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo()
iUserId = objUserInfo.UserID
End Sub
Function HideModule(ByVal tabid As String, ModuleId As String, iuserid As String) As String
Dim dr As IDataReader
Try
Dim str As String = "exec VL_AddHideModule " & iCustomerid & "," & iuserid.ToString() & "," & tabid.ToString() & "," & ModuleId.ToString()
dr = DotNetNuke.Data.DataProvider.Instance().ExecuteSQL(str)
dr.Read()
dr.Close()
Response.Redirect(Request.RawUrl)
Catch ex As Exception
Return "fout"
Finally
End Try
End Function
Protected Sub butHideModule_Click(sender As Object, e As ImageClickEventArgs) Handles butHideModule.Click
HideModule(TabController.CurrentPage.TabID, ModuleControl.ModuleContext.ModuleId, iUserId)
End Sub
End Class
End Namespace
Hope it