I have a simple module in which I am reading data from a file into a SQL table but I have ran into a problem that is driving me crazy. I using DotNetNuke.UI.Skins.Skin.AddModuleMessage to display to the user weather the file successfully completed uploading or if there was an error. The problem I am having is that the message is showing up twice instead of once. Any help is grealty appreciated. The code I am using is posted below.
If fileUpEx.HasFile Then
Dim extension As String = Path.GetExtension(fileUpEx.PostedFile.FileName)
'Check the file extension
If extension = ".csv" Then
Dim filePath As String = Path.Combine(ReadFolderPath, fileUpEx.PostedFile.FileName)
'Save file at ~Portals\0\CAMS\& filename
fileUpEx.PostedFile.SaveAs(filePath)
'Read the file
Readfile(filePath)
Dim oMessage As String = ""
oMessage = Localization.GetString("Success", Me.LocalResourceFile)
DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me, oMessage, _
Skins.Controls.ModuleMessage.ModuleMessageType.GreenSuccess)
'Delete the file
File.Delete(filePath)
End If
End If