Hi guys,
When we write modules we catch errors in for instance the page init like this:
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
Try
'Do stuff
Catch Exception As Exception
ProcessModuleLoadException(Me, Exception)
End Try
End Sub
When an error is thrown, we are getting two messages in the log. First the error message itself is being logged correctly, but then there is an additional page load exception being logged like below:
The Controls collection cannot be modified because the control contains code blocks
at System.Web.UI.ControlCollection.Add(Control child)
at DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException(String FriendlyMessage, Control ctrl, Exception exc, Boolean DisplayErrorMessage)
This has bugged me for some time now and I always kind postponed figurering it out. Can anybody help me to understand this.
Thanks
Pedro