I am working on a version of the Events Module in which I am trying to make categories available on a per module basis. If there are multiple instances of the module used then the categories are unique to each module.
In the core Events module categories are on a per Portal basis.
SelectCategory Page Load:
Dim ctrlEventCategories As New EventCategoryController
Dim lstCategories As ArrayList = ctrlEventCategories.EventsCategoryList(PortalId)
Me.ddlCategories.DataSource = lstCategories
I am using the same SelectCategory.ascx control and am trying to modify it to select on the basis of PortalID and ModuleID. The difficulty I have is that while the PortalID is available at PageLoad in SelectCategory.ascx ModuleID has a value of -1.
Tracing I can see that the ModuleID is valid at PageLoad of my parent ascx. When the PageLoad sub ends for the parent page the PageLoad sub begins for the SelectCategory.ascx but at this point ModuleID has a value of -1.
I have tried storing the value in a property of the base class but I still endup with -1.
Parent ascx:
Namespace SimpleEvents
Partial Public Class SimpleEventMonth
Inherits SimpleEvents.SimpleEventBase
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
log4net.Config.XmlConfigurator.Configure()
log.Debug("Page Load")
log.Debug("ModuleID: " & ModuleId.ToString) '--------------- ModuleID is valid here
Try
CurrentModuleID = ModuleId ' Sore in base class property
. . .
End Sub
SelectCategory.ascx
Namespace SimpleEvents
Partial Public Class SimpleEventSelectCategory
Inherits SimpleEvents.SimpleEventBase
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
log4net.Config.XmlConfigurator.Configure()
log.Debug("Page Load")
If Not Page.IsPostBack Then
log.Debug("ModuleID: " & ModuleId.ToString) '--------------------- ModuleID has a value of -1 here but PortalID seems valid at 0
. . .
Any thoughts?
Declan