This is the code inside the module:
Private agentsDDList As STCustomControls.AgentsListBox
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
Dim m_UserName As String
m_UserName = "" + CType(Session("Username"), String)
Dim u As New UserController
If m_UserName.Length > 0 Then
If Not u.GetCurrentUserInfo.IsSuperUser Then
Me.agentsHolder.Controls.Add(getAgentsSelectBox(agentsHolder))
End If
End If
End Sub
Protected Sub actionChange(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs)
bindData(e.CommandArgument.ToString)
End Sub
Private Sub bindData(ByVal action As String)
Try
Select Case action
Case "criteria"
criteria = getCriteriaByForm(agentsHolder)
colBookingLists = objBookingLists.GetBookingListsByCriteria(ModuleId, CType(Session("Username"), String), CType(Session("Password"), String), criteria)
CriteriaTable.Visible = False
VoucherDatesTable.Visible = False
lstContent.Visible = True
'criteria changed, removing cache
Cache.Remove("dgCache")
lstContent.DataSource = sortDataTable(colBookingLists, ViewState("SortOrder").ToString)
lstContent.DataBind()
Case "editCriteria"
CriteriaTable.Visible = True
VoucherDatesTable.Visible = False
lstContent.Visible = False
End Select
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
Private Function getCriteriaByForm(ByRef ctrlHolder As Control) As Hashtable
Dim arrCrit As New Hashtable
Dim agSel As Specialtours.DNN.STCustomControls.AgentsListBox = STOnlineCommon.FindControlRecursive(ctrlHolder, "AgentsSelBox:" + ctrlHolder.ID)
arrCrit.Add(STOnlineCommon.HASH_SRV_STATUS, txtSrvStatus.Value)
arrCrit.Add(STOnlineCommon.HASH_DOPTION_FROM, optDateIn.Value)
arrCrit.Add(STOnlineCommon.HASH_DOPTION_TO, optDateOut.Value)
arrCrit.Add(STOnlineCommon.HASH_DCREATE_FROM, DateIn.Value)
arrCrit.Add(STOnlineCommon.HASH_DCREATE_TO, DateOut.Value)
arrCrit.Add(STOnlineCommon.HASH_DIN_FROM, creDateIn.Value)
arrCrit.Add(STOnlineCommon.HASH_DIN_TO, creDateOut.Value)
arrCrit.Add(STOnlineCommon.HASH_LEADER, txtLeader.Value)
arrCrit.Add(STOnlineCommon.HASH_MEMO, txtMemoKey.Value)
arrCrit.Add(STOnlineCommon.HASH_REM_CNT_CRIT, agSel.SelectedValue)
arrCrit.Add(STOnlineCommon.HASH_STOL_COAGENT_ID, 0)
arrCrit = formatCriteria(arrCrit)
Return arrCrit
End Function
Private Function getAgentsSelectBox(ByRef holder As Control) As STCustomControls.AgentsListBox
Dim bldp As New BookingList.SqlDataProvider
Dim agents As New Specialtours.DNN.STCustomControls.AgentsListBox
agents.UserID = CType(Session("STOLUserID"), String)
agents.UserName = CType(Session("Username"), String)
agents.Password = CType(Session("Password"), String)
agents.connectionString = bldp.ConnectionString
agents.DefaultText = " All"
agents.DefaultValue = "0"
agents.CssClass = "fldData"
agents.Width = 252
agents.ID = "AgentsSelBox:" + holder.ID.ToString
agents.ctrlHolder = holder
Return agents
End Function
I don't know if this code helps. The problem is that when I am asking agSel.SelectedValue I am getting null