Hello all,
I am writing a module that creates portals, it is very much based on the default code in DNN, I have just moved it to a wizard control and added a few other controls.
I am expreiencing a problem with the portal template selection control, where it is adding all the templates in the site twice.
I have included the code below, it is a copy of the code used by DNN. Please if you can tell me how to prevent this from happening, I would appreciate it. Thank you.
If System.IO.Directory.Exists(strFolder) Then
Dim fileEntries As String() = System.IO.Directory.GetFiles(strFolder, "*.template")
For Each strFileName In fileEntries
If Path.GetFileNameWithoutExtension(strFileName) <> "admin" Then
Me.DropDownListPortalTemplate.Items.Add(Path.GetFileNameWithoutExtension(strFileName))
End If
Next
If Me.DropDownListPortalTemplate.Items.Count = 0 Then
lblMessage.Text = Localization.GetString("PortalMissing", Me.LocalResourceFile)
End If
Me.DropDownListPortalTemplate.Items.Insert(0, New ListItem(Localization.GetString("None_Specified"), "-1"))
Me.DropDownListPortalTemplate.SelectedIndex = 0
End If
Any help would be appreciated.
Thank you